Re: Sort lines in a text file

2007-07-23 Thread James Stroud
Daniel wrote: > On Sun, 22 Jul 2007 06:03:17 +0300, leegold <[EMAIL PROTECTED]> wrote: >> say I have a text file: >> >> zz3 uaa4a ss 7 uu >> zz 3 66 ppazz9 >> a0zz0 >> >> I want to sort the text file. I want the key to be the number after >> the two "zz". Or I guess a string of t

Re: Sort lines in a text file

2007-07-22 Thread leegold
...snip... > > Do your own homework. Hush troll. -- http://mail.python.org/mailman/listinfo/python-list

Re: Sort lines in a text file

2007-07-22 Thread leegold
...snip... > To save anybody who's tempted to write the whole shebang for you, > please specify which part(s) of the exercise you are having problems > with: > (a) reading lines from a file > (b) extracting a sort key from a line [presuming "number" means > "positive integer"; what do you want to d

Re: Sort lines in a text file

2007-07-22 Thread Daniel
On Sun, 22 Jul 2007 06:03:17 +0300, leegold <[EMAIL PROTECTED]> wrote: > say I have a text file: > > zz3 uaa4a ss 7 uu > zz 3 66 ppazz9 > a0zz0 > > I want to sort the text file. I want the key to be the number after > the two "zz". Or I guess a string of two zz then a numberS

Re: Sort lines in a text file

2007-07-22 Thread Daniel
On Sun, 22 Jul 2007 06:03:17 +0300, leegold <[EMAIL PROTECTED]> wrote: > say I have a text file: > > zz3 uaa4a ss 7 uu > zz 3 66 ppazz9 > a0zz0 > > I want to sort the text file. I want the key to be the number after > the two "zz". Or I guess a string of two zz then a numberS

Re: Sort lines in a text file

2007-07-21 Thread John Machin
On Jul 22, 1:03 pm, leegold <[EMAIL PROTECTED]> wrote: > say I have a text file: > > zz3 uaa4a ss 7 uu > zz 3 66 ppazz9 > a0zz0 > > I want to sort the text file. I want the key to be the number after > the two "zz". Or I guess a string of two zz then a numberSo > that's 3, 9,