localhost:ruby young$ cat data.csv
"Date","ISBN","Price"
" 2013- 04- 12" ," 978- 1- 9343561- 0- 4" ,39.45
" 2013- 04- 13" ," 978- 1- 9343561- 6- 6" ,45.67
" 2013- 04- 14" ," 978- 1- 9343560- 7- 4" ,36.95
localhost:ruby young$
localhost:ruby young$ cat data.csv | tail -3 | awk -F"," '{print sum += $3}' | tail -1
122.07
No comments:
Post a Comment