in reply to a simple match and replace script

It sounds like what you want to do is specify that the input record separator be any number of blank lines. Then, for each record, replace the number present with a variable that gets incremented after each paragraph. Finally, output the record, followed by a blank line.

Alex / talexb / Toronto

Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.

Replies are listed 'Best First'.
Re^2: a simple match and replace script
by Aldebaran (Curate) on Aug 09, 2017 at 02:41 UTC

    but every newline does not imply a new paragraph, as in #32, where we have extra space for pen and paper sigs. It might look better on the page to have 2 newlines between numbered terms, might give room for changes and initials.

      OK -- I'd start with something that works (puts one line between every paragraph), then improve that. For example, add two lines after each numbered paragraph -- otherwise, just add one line.

      It's not a requirement (ever) to get right to the golden solution on the first try. Get something that works, even if there's room for improvement. Then .. improve what you have. Repeat as necessary.

      Alex / talexb / Toronto

      Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.