I have a large file that's a couple hundred lines long. This file is partitioned into many parts by a specific identifier, lets say 'ABC'. This line 'ABC' appears 6 times so I want 6 output files. I'm familiar with split and awk but can't seem to create a command line that will do what I've described, any ideas?
Here's an example
ABC
line 1
line 2
line 3
ABC
line 1
line 2
ABC
line1
I'd like three files where ABC is the first line in the new file and it ends before the next ABC is encountered.