I need to re-form my data frame using regexp and in particular this kind of lines
X21_GS04.A.mzdata
it should be:
GS04.A
I tried
pluto <- sub('^X[0-90_]+','', my.data.frame$File.Name, perl=TRUE)
and it works; than i tried
pluto <- sub('.mzdata$','', my.data.frame$File.Name, perl=TRUE)
and it works too.
The problem is that I have no idea how to combine the two codes in one, I tried a script like this
pluto <- sub('^X[0-90_]+ | .mzdata$','', my.data.frame$File.Name, perl=TRUE)
but nothing appears. Can someone tell me where I am going wrong?
Best Riccardo
source share