[R] How to extract particular words from various files

ucakmde maris_dem at hotmail.com
Wed Nov 23 14:44:55 CET 2011


Dear R-help guys,

I am trying to extract two particular words from different files but I am
struggling with the code. The first theree lines of each folder are as
follows: 

# using minimal fraction of valid points 30.00
# tas [K] from bcc-csm1-1 model output prepared for CMIP5 RCP8.5
# cutting out region lon=    0.000  360.000, lat=  -90.000   90.000

In fact, I am trying to extract the model type (i.e. bcc-csm1-1) and the
forcing scenario (8.5) from line 2. They differ in each folder but they
follow the same structure:The model type is between the words "from" and
"model" and the forcing scenario is just after "RCP".

Does anyone know what code to produce to achieve that?

Thank you in advance.



--
View this message in context: http://r.789695.n4.nabble.com/How-to-extract-particular-words-from-various-files-tp4099607p4099607.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list