This is a test version of Biostars. For the public version, visit https://www.biostars.org.
how to seperate names using awk

I have a file like this:

"""

qboundary.0|hg19|chr10:1080001-1280001

boundary.2|hg19|chr10:3040001-3240001

boundary.4|hg19|chr10:4760001-4960001

"""

how to quickly use awk to make it look like this(seperated by TAB):

"""

chr10 1080001 1280001

chr10 3040001 3240001

chr10 4760001 4960001

"""

linux awk shell

1 answer

$ awk -F '\\||:|-' '{OFS="\t"}{print $3,$4,$5}' your_file
chr10   1080001 1280001
chr10   3040001 3240001
chr10   4760001 4960001

Log in to answer this question.