sed: adding lines before/after/inside line groups
On Qua, 13 Jan 2010, green wrote:
My head is about to burst from trying to comprehend sed usage. Perhaps some
kind individual(s) will help me lest my mental capacity by surpassed.
I have a file that looks like this (please pardon the bad, fake lyrics):
I want to convert these to a LyX format that I have established.
The Number: and Title: lines are easy enough to convert; only the Verse: and
Chorus: chunks (which may be 8 lines) are a problem. I need those chunks to
- 1 line added before (different for verse/chorus)
- 2 lines added between lines
- 1 line added after (same for verse/chorus)
It may be possible to do this in sed alone, but a more complete
scripting language, such as perl, python, ruby, etc. will probably
make the job easier, since you'll not be limited to processing each
No man in the world has more courage than the man who can stop after
eating one peanut.
-- Channing Pollock
Eduardo M KALINOWSKI
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact email@example.com