[R] Read large '.csv' files from zipped file
Jianwen Luo
goutyl at 163.com
Wed Jun 24 19:36:32 CEST 2015
Hi all,
I use ireadLines function to iterate large '.csv' files from '.zip' file. When I execute the nextElem function in R console, I can only fetch the first line of file content no matter how many times . Example code show as bellow.
> library(iterators)
> con<-unz(description='g:\\hourly_WIND_2013.zip',filename='hourly_WIND_2013.csv')
> it<-ireadLines(con)
> nextElem(it)
[1] "\"State Code\",\"County Code\",\"Site Num\",\"Parameter Code\",\"POC\",\"Latitude\",\"Longitude\",\"Datum\",\"Parameter Name\",\"Date Local\",\"Time Local\",\"Date GMT\",\"Time GMT\",\"Sample Measurement\",\"Units of Measure\",\"MDL\",\"Uncertainty\",\"Qualifier\",\"Method Type\",\"Method Name\",\"State Name\",\"County Name\",\"Date of Last Change\""
> nextElem(it)
[1] "\"State Code\",\"County Code\",\"Site Num\",\"Parameter Code\",\"POC\",\"Latitude\",\"Longitude\",\"Datum\",\"Parameter Name\",\"Date Local\",\"Time Local\",\"Date GMT\",\"Time GMT\",\"Sample Measurement\",\"Units of Measure\",\"MDL\",\"Uncertainty\",\"Qualifier\",\"Method Type\",\"Method Name\",\"State Name\",\"County Name\",\"Date of Last Change\""
>
Can anybody tell me what did i missed?
Regards
Jianwen Luo
[[alternative HTML version deleted]]
More information about the R-help
mailing list