[text] issue: need to read a big amount of numbers
Hi there,
I'm having a tiny problem here and can't find a simple solution tho there is surely one.
I need to read a text file with a big amount of numbers, approximately 100 000 digits. It is a text file of raws numbers, without any returns.
I read it in [text], so it displays one line of all the digits.
The first idea was to output packets of digits one by one (let's say 10) but text can't output anyway other than line by line.
I could handle the data if it's all together with zl stuffs, but the thing is that text always outputs "set -1" if I require the output of "line 1".
So, does anybody has a better object for this purpose, or does someone can tell me how to make text output enough numbers at a time ?
thanks
com on, bad explanation or is it an endless problem ?
Lobjects might help (Ltocoll especially)
Thanks for the reply,
I can't open any L objects (Ltop Lchange), tho I can see it, is it a library or something ?
rectification, some of them are working, but I can't even see the Ltocoll, if you have a link that'd be great.
cheers
Hi GUYGZ,
a text file with 100.000 digits in one line will make you run into several difficulties. While [text] is able to read such a file (you can see all digitits in the editor window), it will not be able to output the first line completely. The output format of [text] is a list which has a maximum length in Max (don't remember the exact max length now, but it is far below 100.000). Also the [zl] objects will run into the same limitations.
I checked reading a file with 100.000 digits separated by space with javascript and iterate over it. But also there I run into a limitation. JavaScript will read a line only up to 32768 characters (which means 16384 digits + spaces).
Where do you get your data from? do you have the possibility to format the file in multiple lines, or get them from another source such as a SqLite DB?
Cheers
Jan
Hi jan,
thanks for the reply ! I noticed about zl and text maximum lenght but I didn't rely it to max in general.
Tho the idea is not to read those digits in one raw at all. I wanted to read them first and separate the data into packets, to fill a buffer line by line.
If you have an idea to separate them in the outputs with a suitable size packets it would be great, faster than I planned. But the size of the packets has to change. Like, if you separated the data into packets of 10 digits, would it be possible to iterate them in 9 digits packets without loosing any digit (without truncate the data) ?
Thanks anyway