[fpc-pascal] How to split file of whitespace separated numbers?

Bo Berglund bo.berglund at gmail.com
Sat Dec 31 12:18:21 CET 2016


On Sat, 31 Dec 2016 11:27:53 +0100, greim
<greim at schleibinger.com> wrote:

>Hallo Bo,
>
>please try the simple
>
>READ(myfile, x);
>
>as mentioned in my posting from 23.dec.
>It works w/o any postprocessing.
>
I saw that but the problem is that there are varying number of items
on each line and a line is considered a record.
So I would anyway have to keep track of the lines.
With Read I guess it skips all whitespace including line endings and
this causes problems in identifying the content because of varying
number of items on each line.
The Readln approach followed by splitting in a stringlist is enough of
an improvement that I can use it.


-- 
Bo Berglund
Developer in Sweden




More information about the fpc-pascal mailing list