(The code is as clear as your specifications)
>perl -anF, -e "$x{$F[3]}+=$F[1] if $F[1]=~/^\d+/}{print qq|$x{$_}\t$_ +\n| for sort keys %x" data1.txt 2 "456.123.00" 2 "456.147.00" 6 "456.321.07" 5 "456.321.08" 5 "456.321.09" 12 "456.321.11" 6 "456.321.12" 1 "456.321.15" 1 "456.321.29" 1 "456.321.30" 1 "456.321.31" 1 "456.321.32" 1 "456.325.10" 2 "456.325.11" 2 "456.325.15" 2 "456.325.30" 2 "456.325.31" 8 "460.339.01" 16 "460.339.02" 2 "460.339.03" 4 "460.339.04"
"Think of how stupid the average person is, and realize half of them are stupider than that." - George Carlin
In reply to Re: Accumulate values for each data field
by NetWallah
in thread Accumulate values for each data field
by JobC
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |