awk is well suited to this: awk '$1 == "Company1"{sum += $2} END {print sum}' money.txt. awk processes the input file(s) one line at a time, ... ... <看更多>
Search
Search
awk is well suited to this: awk '$1 == "Company1"{sum += $2} END {print sum}' money.txt. awk processes the input file(s) one line at a time, ... ... <看更多>