Java Mailing List Archive

http://www.r-help.com/

Home » Home (12/2007) » R Help for Statistical Computing »

Re: [R] read.fwf and header

Gregor GORJANC

2006-10-30

Replies:

Daniel Nordlund wrote:
> Gregor,
>
> According to the help for read.fwf, sep needs to be set to a value that occurs only in the header record. I changed the spaces to commas in the header record of your example and used the following syntax and was able to read the file just fine.
>
> new.data<-read.fwf(file="test.txt", widths=c(3, 4, 10, 3, 2, 2, 2, 2, 11, 19),
>  header=TRUE, sep=',')
>
> Hope this is helpful,
>
> Dan

Thanks Dan! But I have to modfy file first. Not that much of work but still.

Regards, Gregor

______________________________________________
R-help@(protected)
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
©2008 r-help.com - Jax Systems, LLC, U.S.A.