[R] R equivalent of linux "cut", "paste", and "grep" ?

Gabor Csardi csardi at rmki.kfki.hu
Thu Feb 14 11:10:16 CET 2008


Personally, i would go for a pure R solution, except if the 
files are very large. For that i'm afraid that you need to 
read the whole file, manipulate it and write it back. Or implement
your own 'read' function instead of read.table.

Gabor

On Thu, Feb 14, 2008 at 09:57:14AM +0000, Romain Francois wrote:
> Hi,
> 
> If you are on a linux system, you can use these linux commands through 
> pipe.
> Otherwise :
> - perl would do a great job on this.
> - if you are familiar enough with SQL syntax, you can use the 
> development version of the sqldf package to work on csv files as if they 
> were database tables. See example 8 in http://code.google.com/p/sqldf/
> 
> Cheers,
> 
> Romain
> 
> Ng Stanley wrote:
> > Hi,
> >
> > What functions should I use in order to perform the following steps:
> >
> > 1) Load a particular column (e.g., column 5) from a csv file
> > 2) Append the column 5 to another csv file
> > 3) select those rows that match specific keywords in column 5
> >   
> -- 
> Mango Solutions
> data analysis that delivers
> 
> Introduction to R training course :: London :: 06-07 March 2008
> http://www.mango-solutions.com/services/rtraining/r_intro.html
> 
> ______________________________________________
> R-help at 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.

-- 
Csardi Gabor <csardi at rmki.kfki.hu>    UNIL DGM



More information about the R-help mailing list