[R] using filter while Reading files -

David Winsemius dwinsemius at comcast.net
Tue Sep 15 01:39:27 CEST 2009


On Sep 14, 2009, at 6:25 PM, Santosh wrote:

> Dear R'sians..
> I apologize if this topic has been beaten to death and hope that  
> hawks don't
> pounce on me!
>
> Could you please suggest an efficient way to filter rows from 500+  
> text
> files (some with 30000+ rows with multiple section table headers)  
> residing
> in several folders?  I guess probably "scan" is the fastest way to  
> scan a
> file, but, I noticed it sometimes takes a long time when reading  
> large text
> files.

scan would attempt to parse the files while you could create a long  
character vector composed of entire lines with readLines.

>

David Winsemius, MD
Heritage Laboratories
West Hartford, CT




More information about the R-help mailing list