|
Pages: [1]
|
 |
|
Author
|
Topic: Read/lines for a very big file (Read 345 times)
|
|
rebolnotes
|
I need to parse EACH LINE of a very big file (500 MB). I don't think read/lines will be able to do so. I saw this article http://www.rebol.com/article/0199.htmlbut it doesn't give the equivalent of read/lines for big file. Is there a script somewhere else ? Thanks.
|
|
|
|
|
Logged
|
|
|
|
|
PeterWood
|
As far as I know read/lines can only work if the whole file is read in one operation. You could use the technique in the article to read chunks of the file and then split them into lines using parse...the problem is that you would need to overcome is re-joining lines that are split between chunks: The parse statement is the easy part: >> str: join "abcdef" [ [ newline "ghi" newline "rst"] == "abcdef^/ghi^/rst"
>> parse/all str to string! newline == ["abcdef" "ghi" "rst"] >> str
|
|
|
|
|
Logged
|
|
|
|
|
|
Pages: [1]
|
|
|
 |