[Tutor] how to sort a tab delim file

Hs Hs ilhs_hs at yahoo.com
Wed Jan 13 16:21:44 CET 2010


Hi:

I have a tab-delim file:

col1         col2     col3
andrew    1987   1990
jake         1974   1980
jim           1964   1970
lance        1984   1992


how can I sort column 2 and get :
jim           1964   1970
jake         1974   1980
lance        1984   1992
andrew    1987   1990


I know how to sort a items in one list. but I cannot get how this can be done on a file. 

any suggestions. thanks!
Hs


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100113/3146b518/attachment.htm>


More information about the Tutor mailing list