FunctionRacerProblemsRace

Totals per Group

HardBasha shell script

Each line of sales.csv is a department and an amount, like tools,120. Print one line per department with the department, a space and the sum of its amounts, in alphabetical order of department.

Example 1

sales.csv
tools,120
toys,30
tools,5
books,60
toys,1
prints
books 60
tools 125
toys 31

Constraints

Race itor take your time

Write it in your browser, against the clock. The model script, with a note on each command it uses, comes after.

More Bash problems