Note the extra "\" for the shell (Linux assumed).perl -anF/[\\s,]+/ -e '$tot{$F[0]}+=$F[1]}{print qq|$tot{$_}\t$_\n| fo +r sort keys %tot' <YOUR-FILE-NAME>
"You're only given one little spark of madness. You mustn't lose it." - Robin Williams
In reply to Re: adding values of element
by NetWallah
in thread adding values of element
by new2perl2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |