in reply to array of arrays
You might need different quoting on -F depending on your shell. Add option -MO=Deparse to see the longer code$ perl -F'\|' -nale '$x[$F[0]-1]+=$F[1]}{print"the total is: ($_)"for@ +x' input.txt the total is: (150) the total is: (75) the total is: (55)
|
|---|