![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,297
|
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 ![]() 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' ![]()
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
![]() |
![]() ![]() ![]() ![]() ![]() |