Re: pythonic way to sort

2006-05-04 Thread Boris Borcic
Jay Parlar wrote: > > On May 4, 2006, at 12:12 AM, [EMAIL PROTECTED] wrote: > [...] > Assume that you have the lines in a list called 'lines', > as follows: > > lines = [ >"1SOME STRING ~ABC~12311232432D~20060401~", >"3SOME STRING ~ACD~14353453554G~20060401~",

Re: pythonic way to sort

2006-05-03 Thread Jay Parlar
353453554G~20060401~0000 > > ..... > > What is the pythonic way to sort this type of structured text file? > Say i want to sort by 2nd column , ie ABC, ACD,DEF ? so that it becomes > > 1SOME STRING ~ABC~12311232432D~20060401~ > 3SOME STRING ~ACD~14353453554G~200

Re: pythonic way to sort

2006-05-03 Thread Robert Kern
[EMAIL PROTECTED] wrote: > hi > I have a file with columns delimited by '~' like this: > > 1SOME STRING ~ABC~12311232432D~20060401~ > 2SOME STRING ~DEF~13534534543C~20060401~ > 3SOME STRING ~ACD~14353453554G~20060401~ > > .

pythonic way to sort

2006-05-03 Thread micklee74
hi I have a file with columns delimited by '~' like this: 1SOME STRING ~ABC~12311232432D~20060401~ 2SOME STRING ~DEF~13534534543C~20060401~ 3SOME STRING ~ACD~14353453554G~20060401~ . What is the pythonic way to sort this type of structured