Hacker News new | ask | show | jobs
by alco 4334 days ago
'wc -l' counts the number of lines. It also supports '-c' and '-b'.

To work with input split into columns, use awk. By default, it assumes the columns are separated with spaces. This can be customized with the '-F' option.

So your last example can be rewritten as

    awk -F, '{s+=$1} END{print s}' data.csv