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~",
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
[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~
>
> .
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