![]() |
neat thing for the people that use the envato marketplace
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 http://i.imgur.com/b8kUG.jpg 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 Code:
awk -F '^"|","|"$' '/-/{sum += $5} END {print sum}' *.csv | sed 's/-//; s/^/$/; s/$/ spent/; s/\(.*[0-9]\)\([0-9]\{3\}\)/\1,\2/;t' |
All times are GMT -7. The time now is 11:09 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123