awk - set "\x3b" as a delimiter -
i have file including genes in following format. want process file , make each row show 1 gene (separate multiple genes in 1 line multiple lines).
c10orf32 c10orf32,c10orf32-asmt c19orf33\x3byif1b c19orf73,lin7b c19orf73,ppfia3\x3blin7b
i used following command , want set "," , "\x3b" delimiters, "\x3b" still in outfile, show below
awk 'begin {fs=",|\x3b";} {for (i=1;i<=nf;i++) {print $i}}' file.txt
output:
c10orf32 c10orf32 c10orf32-asmt c19orf33\x3byif1b c19orf73 lin7b c19orf73 ppfia3\x3blin7b
but want
c10orf32 c10orf32 c10orf32-asmt c19orf33 yif1b c19orf73 lin7b c19orf73 ppfia3 lin7b
what doing wrong?
awk 'begin {fs=",|\\\\x3b"} {for (i=1;i<=nf;i++) {print $i}}' file.txt
this works. don't know why though, many time double backslash again work...
Comments
Post a Comment