Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: Read/lines for a very big file
Pages: [1] Print
Author Topic: Read/lines for a very big file  (Read 345 times)
rebolnotes
Newbie
*
Offline Offline

Posts: 23


View Profile
Read/lines for a very big file
« on: August 11, 2007, 02:20:27 PM »

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.html

but it doesn't give the equivalent of read/lines for big file. Is there a script somewhere else ?

Thanks.
Logged
PeterWood
Newbie
*
Offline Offline

Posts: 30


View Profile
Re: Read/lines for a very big file
« Reply #1 on: August 17, 2007, 02:53:23 AM »

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:
Code:
>> str: join "abcdef" [
[    newline "ghi" newline "rst"]
== "abcdef^/ghi^/rst"

>> parse/all str to string! newline
== ["abcdef" "ghi" "rst"]
>> str

Logged
Pages: [1] Print 
Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: Read/lines for a very big file
Jump to:  

  
Quick Search...

Advanced search
  
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 12, 2008, 12:37:20 AM
Username: Password: Session Length:
  

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2251 Posts in 589 Topics by 2420 Members
Latest Member: pharmacytovvv

  Rebol Talk Forum | Powered by SMF 1.0.9.
© 2001-2005, Lewis Media. All Rights Reserved.

RT design by Defiant Pc