My file is:
DIVIDER
Sometext_string
many
lines
of random
text
DIVIDER
Another_Sometext_string
many
many
lines
DIVIDER
Third_sometext_string
....
How change lines following DIVIDER pattern
Result must be:
DIVIDER
[begin]Sometext_string[end]
many
lines
of random
text
DIVIDER
[begin]Another_Sometext_string[end]
many
many
lines
DIVIDER
[begin]Third_sometext_string[end]
....
May be this would help –
Execution:
UPDATE:
This version will handle one blank line after the first DIVIDER.
UPDATE 2:
There are no other questions right now so that I thought I’d offer an alternate
awksolution if you’d like? 🙂This to handle first blank line after DIVIDER –