Let us say I have a list such as :
Foo : 1st chapter
Foo : 2nd chapter
Bar : 1st chapter
Bar : 2nd chapter
Bar : 3rd chapter
Qux : 1st chapter
I want to insert a blank line (except before the first line, of course) each time a line begins with a different pattern (here 3 letters, but it could be 4-digit years : 2010, 2011, 2012, etc…) in order to have :
Foo : 1st chapter
Foo : 2nd chapter
Bar : 1st chapter
Bar : 2nd chapter
Bar : 3rd chapter
Qux : 1st chapter
How should I proceed ? Thanks in advance…
For simplicity: You can
let x=''then:1d