I have a file like:
!Denver
Line 1
Line 2
Line 3
!New York
Line 1
Line 2
I want to do the following - Basically pull the text with prefix ! ( like !Denver ) and append the text , less "!" to the next lines until another ! comes along with new text for proceeding lines
Denver.Line 1
Denver.Line 2
Denver.Line 3
New York.Line 1
New York.Line 2
This is part of a bigger script - but am hoping to complete the rest myself.
I found the following which i am reviewing:
- Add a prefix string to beginning of each line
- How can I prepend a string to the beginning of each line in a file?
- How can I prepend a string to the beginning of each line in a file?
So I may get an answer myself shortly.
Thanks!