perl -e 'while (<>){@a=split;$s{$a[0]}+=$a[1] if $a[1]}print "$_=$s{$_ +}$/"for sort keys %s' texto.txt [fpalacios@linuxtest fpalacios]$ cat texto.txt 12345 99 12345 99 23432 99 54567 20 [fpalacios@linuxtest fpalacios]$ perl -e 'while (<>){@a=split;$s{$a[0] +}+=$a[1] if $a[1]}print "$_=$s{$_}$/"for sort keys %s' texto.txt 12345=198 23432=99 54567=20 [fpalacios@linuxtest fpalacios]$
$_=$,=q,\,@4O,,s,^$,$\,,s,s,^,b9,s, $_^=q,$\^-]!,,print
In reply to Re: Stressed
by hopes
in thread adding numbers from a file (was: Stressed)
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |