sorting a file with records - amended

M

mike

hi

i have a sample file like this (field separator is a space):


orion 13-11-2003 mike
jupiter 11-11-2003 susan
venus 12-11-2002 alvin
neptune 10-11-2002 sharon

i just want to sort this file on the first column by string so
eventaully the output is:

jupiter 11-11-2003 susan
neptune 10-11-2002 sharon
orion 13-11-2003 mike
venus 12-11-2002 alvin

how can i do that just with the sort function from perl??
thanks very much for any help
 
G

Gunnar Hjalmarsson

mike said:
i have a sample file like this (field separator is a space):

orion 13-11-2003 mike
jupiter 11-11-2003 susan
venus 12-11-2002 alvin
neptune 10-11-2002 sharon

i just want to sort this file on the first column by string so
eventaully the output is:

jupiter 11-11-2003 susan
neptune 10-11-2002 sharon
orion 13-11-2003 mike
venus 12-11-2002 alvin

how can i do that just with the sort function from perl??
thanks very much for any help

Was it anything particular in the documentation for the sort function
that you did not understand? Or don't you know where you find the docs?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top