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. ______________________________________________ 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 and provide commented, minimal, self-contained, reproducible code.