Shell: how to split a file with blocks as delimiters
by Linux.tar.gz from LinuxQuestions.org on (#6EVT3)
Hi,
I have a file.txt:
Quote:
I would like to split the file when I met a fixed number or more of consecutive blank lines.
So with 3+ blank lines as a separator, I'd get:
file1.txt:
Quote:
file2.txt:Quote:
file3.txt:Quote:
I have various ideas with counters but I have an efficiency constraint there, and I lack knowledge about advanced features of sed/awk-likes.
So any help is welcome.
I have a file.txt:
Quote:
a b c d e f g h i |
So with 3+ blank lines as a separator, I'd get:
file1.txt:
Quote:
a b c d e f |
g |
h i |
So any help is welcome.