in reply to Add blank line between two consecutive lines starting with specified strings

It is certainly possible. Assuming Windows command line (update: and assuming "black" means "blank"), try (semi-tested):

perl -wMstrict -pe "BEGIN { our $armed } $::armed = /\A \\macroa \s/x +? 1 : /\A \\macrob \s/x && $::armed && ! print qq{\n}" infile > outfi +le


Give a man a fish:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^2: Add blank line between two consecutive lines starting with specified strings
by texuser (Novice) on Feb 10, 2018 at 05:02 UTC
    Thank you, it works.

      I'm glad it works, and you're welcome. Do you understand why it works? We do not aspire to be a code-writing service. Evidence of effort on your part will beget effort on ours. Looking at your admittedly limited posting history ...


      Give a man a fish:  <%-{-{-{-<

        I am grateful for the help I got here. I am new to this. Now that I have some working code I can study perl syntax to understand how to do things and not ask simple questions anymore. I have also found the perl oneliner site which is very useful. Thanks again.