You can do something like this:
con <- file("MyFle.txt","r")
repeat {
line <- readLines(con,n=1)
if (length(line) == 0) break
ParseLine(line)
}
On Sun, Jul 12, 2009 at 6:20 PM, wrote:
> I have a long text file with uneven record length and variable structure.
> Therefore I have to read
I have a long text file with uneven record length and variable structure.
Therefore I have to read it line-by-line.
I found out I can open a connection to the file and read in one line at a time.
Something like:
con <- file("MyFle.txt","r")
while (End-Of-File) {
line <- readLines(con,n=1)
2 matches
Mail list logo