Is it possible to remove the delimiter with csplit? Example:
$ cat in
abc
---
def
---
ghi
$ csplit -q in /-/ '{*}'
$ ls x*
xx00 xx01 xx02
$ head xx*
==> xx00 <==
abc
==> xx01 <==
---
def
==> xx02 <==
---
ghi
Instead of what it did, i.e. split and keep the delimiter, can it be asked to split and remove the delimiter?
That is, the desired output would be this:
$ sed -i '/-/d' xx*
$ head xx*
==> xx00 <==
abc
==> xx01 <==
def
==> xx02 <==
ghi
While it can be done in two steps as above, can it be done in one step?
If it cannot be done with csplit, is there a one-step way that is shorter compared to the two invocations (csplit + sed) above? No preference to a tool used as long as it's reasonably readable.