Is this what you want (using regular expressions):

> x <- "ENSGxxxx /// ENSGyyyyy /// ENSGzzzz"
> sub("^([[:alpha:]]+).*", "\\1 <file://0.0.0.1/>", x)
[1] "ENSGxxxx"
>



On Mon, May 11, 2009 at 9:01 AM, Amélie Baud <amelie30@yahoo.fr> wrote:

> Hi !
>
> >From an Ensembl annotation like ENSGxxxx /// ENSGyyyyy /// ENSGzzzz, I am
> trying to keep only the first part: ENSGxxxx. I wasn't able to find any
> helpful information about how to do it. Could you help me with that please ?
> Is the use of the equivalent to the Excel * (any text) a good way of doing
> it and how ?
> Your help will be very much appreciated.
>
> Amelie
>
>
>
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@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<http://www.r-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?

	[[alternative HTML version deleted]]


