Sorting lines

Martin Baxter mb.userev at harbourhosting.co.uk
Tue May 29 13:39:05 EDT 2007


Jan Schenkel wrote:
> --- runrev260805 at m-r-d.de wrote:
>> Hi, 
>>
>> i have textfile, which contains data. Each line of
>> this text file contains serveral values, which are
>> separated by ;.
>> Each line has the  same number of values. My
>> problems is, that i have to sort the lines by one of
>> the values, in this case by the value of the 4th
>> field.
>>
>>
>> My textfile looks something like this. There are
>> about 42 fields per line.
>>
>> 320;4999;219,Peter;329;366
>> 1000;999;10101;Mark;211;555
>> 2;214;25;Peter;212:667
>> 2;213;13;Josh;215;666
>> 3;23;14;Mark;0;0
>> and so on
>>
>>
>> I have to sort the textfile by the 4th value (the
>> names). I need all lines with the same name in
>> field4 one below the other - similar like this:
>>
>> 2;213;13;Josh;215;666
>> 3;23;14;Mark;0;0
>> 1000;999;10101;Mark;211;555
>> 2;214;25;Peter;212:667
>> 320;4999;219,Peter;329;366
>>
>> How should i solve this? 
>>
>> I hope i described it a little understandable.
>>
>> Regards,
>>
>> Matthias
>>
> 
> Hi Matthias,
> 
> Try the following:
> ##
> set the itemDelimiter to ";"
> sort lines of tVariable by item 4 of each
> ##
> 
> Hope this helped,
> 
> Jan Schenkel.

Erm, this doesn't seem to work here in 2.8.1 on win XP. The 
itemdelimiter appears to be ignored.

Martin Baxter



More information about the use-livecode mailing list