Sum a Column
Each line of sales.csv is a name, a city and a whole number, with commas between them. Print the sum of the numbers.
Example 1
sales.csv
ada,boston,120 ben,miami,80 cy,austin,5
prints
205
Constraints
- 1 to 15 lines
Write it in your browser, against the clock. The model script, with a note on each command it uses, comes after.
More Bash problems
- Swap Two ColumnsMedium
- The Longest LineMedium
- The Most Common WordMedium
- Busiest VisitorsHard
- Lines of CodeHard
- Only in the FirstHard
- Share of ErrorsHard
- Shift Them UpHard