Code Comments
Programming Forum and web based access to our favorite programming groups.Dear all, I have a file like this 0 N3:A131:OG 0 O5:A131:HG 2 N3:A131:OG 3 N3:A131:OG 5 N3:A131:OG 6 N19:A131:OG 7 S21:A105:HD22 8 N2:A131:OG 8 O7:A131:HG and I would like to change to 0 N3:A131:OG O5:A131:HG 2 N3:A131:OG 3 N3:A131:OG 5 N3:A131:OG 6 N19:A131:OG 7 S21:A105:HD22 8 N2:A131:OG O7:A131:HG Do anybody have any idea? Thank you very much.
Post Follow-up to this messagejuihuahsieh@nhri.org.tw (moggces) writes:
> Dear all,
> I have a file like this
[...]
> and I would like to change to
[...]
1 {stuff[$1] = stuff[$1] " " $2; if ($1 > max) max = $1;}
END {for (foo=0; foo<=max; ++foo) if (foo in stuff) print foo,stuff[foo];}
HTH
Ulrich
--
"Reinigungsbenzin? Das nehmen doch die in der Reinigung..."
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.