Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Help with converting Python script to Perl for CSV sort

by poj (Abbot)
on Jan 31, 2017 at 14:52 UTC ( [id://1180692]=note: print w/replies, xml ) Need Help??


in reply to Help with converting Python script to Perl for CSV sort

Can the same code be used for both?

Not exactly, to sort field 2 alpha

sort { $a->[1] cmp $b->[1] }

or field 1 numeric

sort { $a->[0] <=> $b->[0] }
poj

Replies are listed 'Best First'.
Re^2: Help with converting Python script to Perl for CSV sort
by jasonwolf (Sexton) on Jan 31, 2017 at 15:40 UTC
    Understand... Thank you. I am currently reviewing the "sort" page to understand the capabilities. Much appreciated.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1180692]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-25 13:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found