Here are two ways of doing it in R:
foo <- "TF_list_to_test10004/Nus_k0.345_t0.1_e0.1.adj:PKMYT1"
# Remove all before and up to ":":
gsub(".*:","",foo)
# Extract everything behind ":":
regmatches(foo,gregexpr("(?<=:).*",foo,perl=TRUE))
More Related Contents:
- Some troubles with using sed and awk [closed]
- Enhancement of unix script [closed]
- Replace values greater than zero with 1 in r
- How to select lines between two marker patterns which may occur multiple times with awk/sed
- How can I do a recursive find/replace of a string with awk or sed?
- Bash tool to get nth line from a file
- How to delete duplicate lines in a file without sorting it in Unix
- Why does my tool output overwrite itself and how do I fix it?
- How to replace NA values in a table for selected columns
- Replace NA in column with value in adjacent column
- Replace specific characters within strings
- sed or awk: delete n lines following a pattern
- Replace all particular values in a data frame
- Match values in data frame with values in another data frame and replace former with a corresponding pattern from the other data frame
- How to replace NaN value with zero in a huge data frame?
- Replace given value in vector
- Print lines in one file matching patterns in another file
- Replace values in a vector based on another vector
- in R, use gsub to remove all punctuation except period
- Uppercasing First Letter of Words Using SED
- R: Replace multiple values in multiple columns of dataframes with NA
- Replacing occurrences of a number in multiple columns of data frame with another value in R
- Using get() with replacement functions
- Replace a value NA with the value from another column in R
- Replace all values in a matrix
- Replace in a factor column
- Replace empty values with value from other column in a dataframe
- replacing values in a column with another column R
- Select columns based on string match – dplyr::select
- Double quotes not escaped in R