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 <[EMAIL PROTECTED]> wrote:
> Hi Al
: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of sean
> Sent: Friday, 7 March 2008 8:06 a.m.
> To: r-help@r-project.org
> Subject: [R] Help with parsing a data file
>
> Hi All,
>
> I need to parse data from a file, example shown below. The
> first two lines ca
Hi All,
I need to parse data from a file, example shown below. The first two lines
can be skipped, the third line contains the column names. The next 13 lines
can be skipped. The next line "1991" is a year value, with the following 13
values data for that year. The file then repeats this forma
3 matches
Mail list logo