search for: myfile_short

Displaying 1 result from an estimated 1 matches for "myfile_short".

2007 Feb 02
5
reading very large files
...ever my computer seems not able to handle the 1.8 G file. I thought of an alternative way that not require to read the whole file: sel <- sample(1:900000, 3000) for (i in 1:3000) { un <- scan("myfile", what= character(), sep = "\n", skip=sel[i], nlines=1) write(un, "myfile_short", append=TRUE) } This works on my computer; however it is extremely slow; it read one line each time. It is been running for 25 hours and I think it has done less than half of the file (Yes, probably I do not have a very good computer and I'm working under Windows ...). So my question is:...