parse a line into fields

Ken Ray kray at sonsothunder.com
Fri Aug 26 10:04:02 EDT 2005


On 8/26/05 8:31 AM, "rev at armbase.com" <rev at armbase.com> wrote:

> Hi All.
> 
> I've read a binary file containing entries in a database and put each record
> on
> a line in a field.
> 
> I dont know how to write in a wee square so imagine the 9 is a square.
> 
> The fields has records in it like this
> 999oppn9999date9999loca9999rslt9999fltr9999note9999rec1999rec2
> 999rec399rec4999rec599rec6
> Now the number of squares can be variable (normally from 2->4) and the line
> can
> have blank spaces in it (not in amongst the squares)

You can use a variation of the code I mentioned a few days ago... at that
time, I was trying to convert space runs of 1 or more spaces to only be 1
space. You can use the same approach for converting your box characters to
some other delimiter (like a tab) for easy processing.

Something likes this (assuming your boxes are something like numToChar(1)):

  put replaceText(tData,numToChar(1) & "+",tab) into tData

HTH,


Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com





More information about the use-livecode mailing list