Re: [R] Write to multiple connections or multiple text files

2009-01-23 Thread Charles C. Berry
On Fri, 23 Jan 2009, Andersson, Jafet wrote: Hi all, I want to modify a large number of text files (ca 4000) by replacing a value found on a particular line in them with a value from an R object. For a single file I would normally use: con<-file ("foo.txt", open="r+") content<-

Re: [R] Write to multiple connections or multiple text files

2009-01-23 Thread jim holtman
The solution you have seems to read in all the lines of data at once, operate on them and then write them out as a whole chunck. Having multiple connections open won't really help since I/O is serial. So is the code you included the actual code, or just an example? It would help to see what the

[R] Write to multiple connections or multiple text files

2009-01-23 Thread Andersson, Jafet
Hi all, I want to modify a large number of text files (ca 4000) by replacing a value found on a particular line in them with a value from an R object. For a single file I would normally use: con<-file ("foo.txt", open="r+") content<-readLines(con)