Entering edit mode
5.4 years ago
erick_rc93
▴
30
I have multiples genbak (.gbk) files, and each file is a concatenated file with multiple chromosomes and plasmids and I would like to split in single files, I'm trying with the next code in awk
awk -v n=1 '/^\/\//{close("out"n);n++;next} {print > "out"n}' filename.gbk
I'd like to get the output file with the same name of input file:
filename_1.gbk
filename_2.gbk
filename_3.gbk
I would strongly suggest using a proper parser like BioPython for this.
If for some reason you cannot, it should be sufficient to split the files up between the
LOCUS
and//
lines.