ENGL: wrote regexp to tidy up start and end of lines
AK emailed with a sample of data that he wanted normalized.
As an example, if the lines in the text file were this:
Though yet of Hamlet our dear brother's death
The memory be green,
Yet so far hath discretion fought with nature
That we with wisest sorrow think on him,
I'd end up with this:
<p begin="00:00:05.00" style="1"> Though yet of Hamlet our dear brother's death </p>
<p begin="00:00:05.00" style="1"> The memory be green, </p>
<p begin="00:00:05.00" style="1"> Yet so far hath discretion fought with nature </p>
<p begin="00:00:05.00" style="1">That we with wisest sorrow think on him, </p>
I gave him a regexp to do each of the three steps individually along with some explanatory notes and screen snaps, and the following regexp to do it all in one shot (at cost of one additional carriage return character appended to end of file):
find:
^\s*(\w.*?)\s*$
replace:
<p begin="00:00:05.00" style="1">\1</p>\r\r