Created
February 11, 2016 16:45
-
-
Save navdove/29278655e6ac2f6689a5 to your computer and use it in GitHub Desktop.
Bash shell one liner to parse numbers and manipulate them (sum for e.g) using awk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grep 'DEPOSIT' sample.bankstmt.csv | cut -d ',' -f4 | awk '{s+=$1} END {print s}' | |
//produces correct output by summing the numbers | |
//951.95 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11/14/2014 | GC 1020-DEPOSIT | 85.7 | ||
---|---|---|---|---|
12/31/2014 | GC 2122-DEPOSIT | 47.45 | ||
01/30/2015 | GC 2122-DEPOSIT | 54.6 | ||
03/02/2015 | GC 2122-DEPOSIT | 44.8 | ||
03/31/2015 | GC 2122-DEPOSIT | 388.8 | ||
03/31/2015 | GC 2122-DEPOSIT | 34.8 | ||
06/01/2015 | GC 1020-DEPOSIT | 61.8 | ||
07/21/2015 | GC 1020-DEPOSIT | 72.15 | ||
08/14/2015 | GC 1020-DEPOSIT | 24.15 | ||
09/15/2015 | GC 2122-DEPOSIT | 51.2 | ||
10/19/2015 | GC 2122-DEPOSIT | 40.9 | ||
11/13/2015 | GC 2122-DEPOSIT | 45.6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment