Skip to content
Prev 244963 / 398503 Next

Numbers in a string

Hi Felipe,

gsub("[^0123456789]", "", "AB15E9SDF654VKBN?dvb.65")
results in "15965465".
Would that be what you are looking for?


Nick Sabbe
--
ping: nick.sabbe at ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure Links 653, 9000 Gent
ring: 09/264.59.36

-- Do Not Disapprove




-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of Rainer Schuermann
Sent: woensdag 15 december 2010 11:19
To: r-help at r-project.org
Subject: Re: [R] Numbers in a string

If your OS is Linux, you might want to look at sed or gawk. They are very
good and efficient for such tasks.
You need it once or as a part of program? 
Some samples would be helpful...
Rgds,
Rainer


-------- Original-Nachricht --------