[R] Parsing txt file

Mike Marchywka marchywka at hotmail.com
Wed Nov 10 12:39:42 CET 2010


----------------------------------------
> From: santosh.srinivas at gmail.com
> To: karthick.lakshman at gmail.com; r-help at r-project.org
> Date: Wed, 10 Nov 2010 16:00:26 +0530
> Subject: Re: [R] Parsing txt file
>
> You could use the following to achieve your objective. To start with
>
> ?readLines
> ?strsplit
> ?for
> ?ifelse
>
> As you try, you may receive more specific answers for the issues you come up
> with.

If you don't have some compelling reason to do it in R, it may be worth
the learning curve to get something like awk, perl, or even sed.
These tasks come up in many settings and these tools are quite verstatile
for ad hoc text manipulation. You can save your reformatted text
file in a form that is easy for R.


>
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
> Behalf Of karthicklakshman
> Sent: 10 November 2010 15:06
> To: r-help at r-project.org
> Subject: [R] Parsing txt file
>
>
> Hello,
>
> I have a tab limited text document with multiple lines as mentioned below,
>
>
> ______________________________________________
> 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.
>
> ______________________________________________
> 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.
 		 	   		  


More information about the R-help mailing list