[R] Can't import this 4GB DATASET
iliketurtles
isaacm200 at gmail.com
Sat May 5 05:21:14 CEST 2012
Your code works!
strangelines.txt was created, and it's a text file with just spacebars ...
Seems like a few thousand lines of complete blanks (not 1 non-blank entry).
One thing, when I ran your code there was an error message;
> setwd("C:/Users/admin/Desktop/hons/Thesis")
> con <- file("dataset.txt", "rt")
> out <- file("strangelines.txt", "wt")
> # skip first 5 lines
> lines <- readLines(con, n=5)
> # read the rest in blocks of 100.000 lines
> while (TRUE) {
+ lines <- readLines(con, n=1E5)
+ if (length(lines) == 0) break;
+ strangelines <- lines[nchar(lines) != 97]
+ writeLines(strangelines, con=out)
+ }
Warning message:
In readLines(con, n = 1e+05) : incomplete final line found on 'dataset.txt'
I'm really not sure where to go from here. This has gone way out of my
depth.
-----
----
Isaac
Research Assistant
Quantitative Finance Faculty, UTS
--
View this message in context: http://r.789695.n4.nabble.com/Can-t-import-this-4GB-DATASET-tp4607862p4610446.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list