UNIX-style sort in Python?

Kotlin Sam xavier_onasis at hotmail.com
Sun Oct 17 20:11:25 EDT 2004


For a while at least I have to work in Windows rather than UNIX, which 
is more familiar. I'm trying to do with Python some of the things that 
I've done for years in shell, in particular, sort. The shell sort is 
pretty easy to use:
   % sort -t, +2 +5 imputfilename <return>

   where -t is the field separator, in this case a comma, , and +2 and 
+4 are the fields to be sorted, in that order. Actually, the fields are 
zero-based, so the first and third fields would be the sorted.

   So, is there a module or function already available that does this?

Lance




More information about the Python-list mailing list