0
I want to write a script that finds a open/close tag pair in a text file and prepends a fixed string to each line between the pair. I figure I use grep to find the tag line numbers and either awk or sed to place the tags, however, I'm not sure how exactly to do it.
Can someone help?
2
Let's hope it's not HTML tags: http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags :)
– John T – 2010-02-01T20:34:09.933I'm thinking about something like if you put
;tag; <text> ;tag;
then my program will go through and prependtag
to every line of<text>
. I'm working on a note taking tool using markdown, but it's a pain to manually put a>
on every line, or even> >
:-p – Ritwik Bose – 2010-02-01T20:37:36.570