Skip to content
Back to formatted view

Raw Message

Message-ID: <Law11-F111cYUhN5HyR00012433@hotmail.com>
Date: 2003-04-30T11:51:00Z
From: R A F
Subject: Scanning data files line-by-line

Hi all, is there a way to read a data file into R line-by-line, akin
to what fscanf does in C, say?

It seems that "scan" and "read.table" both read the entire data file
in at once, whereas "readLines" allows one to read a file partially,
but doesn't quite read line-by-line either.

I guess what I was hoping to do is something like this:

while( linebyline( "file" ) != end of file )
{
    process each line
    ....
}

Thanks.