Hi Cor, I would say: 1) convert all the floating points in the currency values to points (I have a class that can do that if you need) 2) iterate through all the arrays, convert the items to number and if that value !NaN, push the currency values to a new array 3) sort the resulting array numerically and ... voila HTH Willem van den Goorbergh
On 26 feb 2011, at 17:39, Cor wrote: > I read in a txt file with different formats which can be interpreted as > columns. > There are 3 types of text files where every line of text is formatted like > this: > > text - text - currency - currency - text - text - text > > or this: > > text - text - text - currency - currency - currency - text - text - text - > text > > or this: > > text - text - text - text - currency - currency - currency - currency - > text - text - text - text - text > > I trim of all the spaces and put every line in an multidimensional array > with every item in its sub-array > I then would like to detect which currency item is the lowest. > There are empty currency fields, so those have to be discarded. > All the items are String data type and the "floating point" is a comma > because it is a European format. > > How can I iterate through these items with the lowest price as result? > Also any better approach is appreciated! > > > regards, > Cor > > _______________________________________________ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= Geografiek is a Dutch, Utrecht-based map and chart design company. Willem van den Goorbergh can be contacted by telephone: (+31)30-2719512 or cell phone: (+31)6-26372378 or by fax: (+31)302719687 snail mail: Hooghiemstraplein 89 3514 AX UTRECHT Visit our website at: www.geografiek.nl twitter: @wvdgoorbergh =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders