You may investigate a solution based on regular expressions. Some tutorials to help: regular-expressions.info/rlanguage.html endmemo.com/program/R/grep.php biostat.mc.vanderbilt.edu/wiki/pub/Main/SvetlanaEdenRFiles/regExprTalk.pdf rstudio-pubs-static.s3.amazonaws.com/74603_76cd14d5983f47408fdf0b323550b846.html stat545.com/block022_regular-expression.html youtube.com/watch?v=q8SzNKib5-4 -- Best, GG [[alternative HTML version deleted]]