fork(1) download
  1. x <- c(1:3)
  2. y <- c('"gene_biotype \"lincRNA\"; gene_id \"ENSG00000224818\"; gene_name \"RP11-134G8.8\"',
  3. '"gene_biotype \"processed_transcript\"; gene_id \"ENSG00000261067\"; gene_name \"RP11-264B17.3\"',
  4. '"gene_biotype \"processed_transcript\"; gene_id \"ENSG00000261067\"; gene_name \"RP11-264B17.3\"')
  5. dat <- data.frame(x,y)
  6. library(stringr)
  7. dat$x <- str_extract(dat$y, '(?<=gene_id ")[^"]+')
  8. dat
Success #stdin #stdout 0.24s 42844KB
stdin
Standard input is empty
stdout
                x
1 ENSG00000224818
2 ENSG00000261067
3 ENSG00000261067
                                                                                           y
1               "gene_biotype "lincRNA"; gene_id "ENSG00000224818"; gene_name "RP11-134G8.8"
2 "gene_biotype "processed_transcript"; gene_id "ENSG00000261067"; gene_name "RP11-264B17.3"
3 "gene_biotype "processed_transcript"; gene_id "ENSG00000261067"; gene_name "RP11-264B17.3"