Re: [CentOS] tricky perl question - ascending order

2010-05-23 Thread Kahlil Hodgson
On 05/24/2010 06:39 AM, Jozsi Vadkan wrote: > The solution [from the FreeBSD mailing list]: > > perl -00 -e 'print map $_->[0], sort { $a->[1] <=> $b->[1] } map [$_, > tr/\n//], <>' < before.txt > after.txt > > Thank you!! FYI a lovely piece of magic from 1994:-) http://en.wikipedia.org/wiki/Sc

Re: [CentOS] tricky perl question - ascending order

2010-05-23 Thread Eduardo Grosclaude
On Sun, May 23, 2010 at 5:39 PM, Jozsi Vadkan wrote: > The solution [from the FreeBSD mailing list]: > > perl -00 -e 'print map $_->[0], sort { $a->[1] <=> $b->[1] } map [$_, > tr/\n//], <>' < before.txt > after.txt Wow... -- Eduardo Grosclaude Universidad Nacional del Comahue Neuquen, Argentin

Re: [CentOS] tricky perl question - ascending order

2010-05-23 Thread Eduardo Grosclaude
On Sun, May 23, 2010 at 1:15 PM, Jozsi Vadkan wrote: > or maybe in bash.. > script/"one liner" e.g.: input: http://pastebin.com/raw.php?i=pMZPEsMZ > > i want to make this output from it: > http://pastebin.com/raw.php?i=kH8VxT0A > > > So from the input, i want to make an ascendant order, how many t

Re: [CentOS] tricky perl question - ascending order

2010-05-23 Thread Jozsi Vadkan
The solution [from the FreeBSD mailing list]: perl -00 -e 'print map $_->[0], sort { $a->[1] <=> $b->[1] } map [$_, tr/\n//], <>' < before.txt > after.txt Thank you!! > or maybe in bash.. > script/"one liner" e.g.: input: http://pastebin.com/raw.php?i=pMZPEsMZ > > i want to make this output fro

[CentOS] tricky perl question - ascending order

2010-05-23 Thread Jozsi Vadkan
or maybe in bash.. script/"one liner" e.g.: input: http://pastebin.com/raw.php?i=pMZPEsMZ i want to make this output from it: http://pastebin.com/raw.php?i=kH8VxT0A So from the input, i want to make an ascendant order, how many things are under a "SOMETHING-XX" Does anyone has any "perl magic"