Remove all text before colon

后端 未结 9 1180
天命终不由人
天命终不由人 2020-11-27 12:45

I have a file containing a certain number of lines. Each line looks like this:

TF_list_to_test10004/Nus_k0.345_t0.1_         


        
9条回答
  •  粉色の甜心
    2020-11-27 13:43

    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))
    

提交回复
热议问题