Skip to content
Prev 138777 / 398506 Next

Help with parsing a data file

Try this:

lines <- readLines('yourfile')
newLines <- lines[-(1:(13+3))]
coln <-  scan(textConnection(lines[3]), what="")
lapply(which(nchar(newLines) == 4),
function(x)read.table(textConnection(newLines[seq(x + 1, x + 13)]),
col.names=coln))
On 06/03/2008, sean <smachin1000 at gmail.com> wrote: