Sorting lines

Jan Schenkel janschenkel at yahoo.com
Tue May 29 13:17:59 EDT 2007


--- 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.

Quartam Reports for Revolution
<http://www.quartam.com>

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)


       
____________________________________________________________________________________Sick sense of humor? Visit Yahoo! TV's 
Comedy with an Edge to see what's on, when. 
http://tv.yahoo.com/collections/222



More information about the use-livecode mailing list