[R] How long does skipping in read.table take
Dimitri Liakhovitski
dimitri.liakhovitski at gmail.com
Sat Oct 23 13:44:37 CEST 2010
Gabor,
maybe some of my code is wrong (I don't know sql at all). I tried the
following with just a few lines as a test:
library(sqldf)
mydata<-read.csv.sql("myfile.txt",sep="|", sql = "select * from file 200, 100")
But it's just hanging. The same happened when I wrote:
mydata<-read.csv.sql("myfile.txt",sep="|", eol = "\n",sql = "select *
from file 200, 100")
I am not sure if I should use eol. My file is a .txt file and the
delimiter is "|". At the end of the line there is just the last entry,
nothing else (at least not visible).
Thank you for your help!
Dimitri
On Fri, Oct 22, 2010 at 9:53 PM, Gabor Grothendieck
<ggrothendieck at gmail.com> wrote:
> On Fri, Oct 22, 2010 at 9:45 PM, Dimitri Liakhovitski
> <dimitri.liakhovitski at gmail.com> wrote:
>> Gabor,
>> thanks a lot - sqldf might be a solution. However, do you know if
>> sqldf can also read in .txt files (with different delimiters)?
>> The data I am dealing with is "|" - delimited. So, I was using
>> read.table(...,sep="|")
>> I looked at sqldf description - but did not see examples with .txt.
>>
>
> Yes, it accepts sep and the other arguments specifically documented in
> ?read.csv.sql
>
> --
> Statistics & Software Consulting
> GKX Group, GKX Associates Inc.
> tel: 1-877-GKX-GROUP
> email: ggrothendieck at gmail.com
>
--
Dimitri Liakhovitski
Ninah Consulting
www.ninah.com
More information about the R-help
mailing list