470,849 Members | 925 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,849 developers. It's quick & easy.

sorting a file with records - amended

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
Jul 19 '05 #1
1 1397
mike wrote:
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?

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Lad | last post: by
40 posts views Thread by Elijah Bailey | last post: by
8 posts views Thread by Matthew Curiale | last post: by
6 posts views Thread by Osiris | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.