[R] problem reading csv file

From: Petr Pikal <p.pik_at_centrum.cz>
Date: Tue, 19 Apr 2011 20:47:52 +0200

Dear all

I have several files which claim to be *.csv (one attached, maybe it will come through) . They can be read to Open Office without much problem, however I can not read them into R. I tried read.table("H2O.CSV", sep=",", dec=".")
1 1
> read.table("H2O.CSV", sep=",", dec=".", skip=1)
Error in read.table("H2O.CSV", sep = ",", dec = ".", skip = 1) : empty beginning of file

> readLines("H2O.CSV", 1)

[1] "1"

> readLines("H2O.CSV", 5)

[1] "1" "" "" "" ""

readChar("H2O.CSV", 10)
[1] "1"
> readBin("H2O.CSV", 10)

[1] 9.456937e-308

This is how first two lines appear in Notepad


The problem seems to be in first item "1" which somehow blocks further values to be read.

Does anybody have idea what to do or where to look for some help? I do not want to transfer files through spreadsheet manually.

Best regards

R-help_at_r-project.org mailing list
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. Received on Tue 19 Apr 2011 - 19:54:11 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 19 Apr 2011 - 20:40:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive