[R-sig-Geo] reading a large TXT file and save in chunk

Sean O'Riordain seanpor at acm.org
Tue May 15 22:15:03 CEST 2012


Hi Gianni,
You don't say what you are doing with the data, and it doesn't appear
from here to be very 'geo' :-)

if you are using read.table() then there is the nrows=1000000 option -
followed by write.table() in a loop etc...

You could aways says readLines('blah.txt', n=1000000) followed by
writeLines() in a loop...

Outside of R, if you are on linux etc, then there is the "split -l
1000000" command.

cheers,
Sean


On 15 May 2012 19:09, gianni lavaredo <gianni.lavaredo at gmail.com> wrote:
> Dear Researchers,
>
> I am looking for a post or function to reading a txt file of 800 Mb of
> 20,332,138 rows and split in sevarl chunk that each contain the same number
> of points (i.e. each file of 1,000,000 except for the last one)
>
>
> do you know any link or suggestions?
>
> Thanks in Advance
> Gianni
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



More information about the R-sig-Geo mailing list