Sadık KILIÇ

Web Tabanlı Hafıza Yerleşimi

Perl son kolona göre sıralama

$ more sadik.test 
a@b@c@2
a@b@5
a@b@c@d@3
a@b@c@1
a@b@c@4
perl -e "print sort {(split '@', \$a)[-1] <=> (split '@', \$b)[-1]} <>" sadik.test

Output:

$ perl -e "print sort {(split '@', \$a)[-1] <=> (split '@', \$b)[-1]} <>" sadik.test 
a@b@c@1
a@b@c@2
a@b@c@d@3
a@b@c@4
a@b@5

Perl: sort by last column

,

Leave a Reply

Your email address will not be published. Required fields are marked *