Have you considered 'scan' or 'read.table'? This is what is mostly used in these situations. Read the chapter in the Intro to R on reading in data.
On Tue, May 4, 2010 at 8:10 PM, Seth <sjmy...@syr.edu> wrote: > > Hi, > I am reading a large space-delimited text file into R (41 columns and many > rows) and need to do run each row's values through another R object and > then > write to another text file. So, far using readLines and writeLines seems > to > be the best bet. I've gotten the data exchange working except each row is > read in as one 'chunk', meaning the row has all values between two quotes > ("41 numbers"). I need to split these based upon the spaces between them. > What is the simplest means of doing this? > > Code so far. > > datin<-file("C:\\rforest\\data\\aoidry_predictors_85.txt", open="rt") > datout<-file("C:\\rforest\\prob85.txt",open="wt") > x<-readLines(datin,n=1) > writeLines(x,con=datout) > > Thanks, > Seth > -- > View this message in context: > http://r.789695.n4.nabble.com/readLines-with-space-delimiter-tp2130255p2130255.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html<http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. > -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.