View Single Post
Old 05-20-2013, 07:50 AM   #2
Senior Member
Location: East Coast USA

Join Date: Feb 2008
Posts: 7,080

See if this works.

awk '/^track/{x="Track"++i".bed";}{print > x;}' your_bed_file
This should produce multiple files (one for each track) with names like "Track1.bed Track2.bed" etc. Modify the word highlighted in red to get corresponding file names.

Last edited by GenoMax; 05-20-2013 at 07:55 AM.
GenoMax is offline   Reply With Quote