lets say that I have a txt file that has this in it 335.98, 2621.98, 96.1529, 21.9061 now obviously they are seperated by a comma. I need a script to read the line (which I know how to do) but then I need to be able to seperate the numbers into variables.. ie.. AmountOfMoney=335.98 so I can call %AmountOfMoney% elsewhere and that variable would =335.98
thanks..
Don't know how to do this please help.
Moderators: JRL, Dorian (MJT support)
Use ReadLn to get the line from the file and Separate to split the line into separate variables.
ReadLn>filename,linenumber,line
Let>delim=,
Separate>line,delim,fields
You now have fields_1, fields_2, fields_3 etc containing each portion.
You probably want this in a loop to read each line one by one? In which case something like this:
Let>delim=,
Let>k=1
Label>start
ReadLn>filename,k,line
If>line=##EOF##,finish
Separate>line,delim,fields
bla bla
Let>k=k+1
Goto>start
Label>finish
See example in help file upon which this is based.
ReadLn>filename,linenumber,line
Let>delim=,
Separate>line,delim,fields
You now have fields_1, fields_2, fields_3 etc containing each portion.
You probably want this in a loop to read each line one by one? In which case something like this:
Let>delim=,
Let>k=1
Label>start
ReadLn>filename,k,line
If>line=##EOF##,finish
Separate>line,delim,fields
bla bla
Let>k=k+1
Goto>start
Label>finish
See example in help file upon which this is based.
MJT Net Support
[email protected]
[email protected]