I have a file with some lines starting with ‘>’ and all other lines starting with some letters. I would like to cut my big file into several smaller so that the cut would always be immediately before line with ‘>’.
I remember once I could write something like that in bash on my own, but unfortunately I did not save the copy.
for example
>1
HAVE
ANIC
EDAY
>2
FOLK
SE
>3
SUNS
HINE
will result into 3 files, each having ‘>’ at the first line.
try this, see if it helps
the generated filenames would be 1.txt, 2.txt…..
if you need the special name pattern, the awk line (after >) need to be changed.