Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • There may be some limitation on the length of the part between START and END (there was on old awks, but as I use "gensub" (and thus, gawk) I'm sure the limit, if any, is very big) Commented Jan 13, 2022 at 15:06
  • Wouldn't awk need RS="\0" here? (possible for gawk not mawk AFAIK) Especially since you seem to also want to cover multi-line pattern range matches. Commented Jan 13, 2022 at 15:06
  • @FelixJN : I am not sure why that would be needed, please elaborate (note that : I "conceal" the original '\n' into '\004', and add new '\n' via a temporary '\001' that is then translated to '\n' (to ensure the intermediate state have START at the beginning of a line, and END always followed by a newline). Ie, the START...END is on 1 line only (no \n inside, as they were replaced with \004) Commented Jan 13, 2022 at 15:09
  • Ah yes, I missed this double translation and using \004 as placeholder for the original newlines. Commented Jan 13, 2022 at 15:30