[R] Regex question

From: Andrej Kastrin <andrej.kastrin_at_siol.net>
Date: Sun 29 Jan 2006 - 07:54:34 EST


Dear R useRs,

is there any simple, build in function to match specific regular expression in data file and write it to a vector. I have the following text file:

*NEW RECORD
*ID-001
*AB-text

*NEW RECORD
*ID-002
*AB-text

etc.

Now I have to match all ID fields and print them to a vector: 001
002
etc.

I know that this is very simple with Perl or R-Perl interface, but if possible, I want to do that 'on the hard way'.

Cheers, Andrej



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sun Jan 29 08:01:17 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:14 EST