you can't download all your statements in 1 file, only by month, I wanted to find a quick way to add up the totals amount spent, with awk and sed, you can do this in 1 command.
Thought I would share if anyone else can use this.
As you can see I have quite a few statements
two ways you can do it, using awk and sed or awk and printf (this is only used for adding commas mainly cosmetic)
awk and printf (relies on locale)
Code:
awk -F '^"|","|"$' '/-/{sum += $5} END {printf "$%'\''d spent\n",sum}' *.csv
awk and sed
Code:
awk -F '^"|","|"$' '/-/{sum += $5} END {print sum}' *.csv | sed 's/-//; s/^/$/; s/$/ spent/; s/\(.*[0-9]\)\([0-9]\{3\}\)/\1,\2/;t'
