On Wed, 5 Apr 2023 davidson wrote:
Attached (unless the listserv software has nuked it) is a sed script "flow" (with verbose comments) which might serve your needs. (Since you have not exhibited here any of the text you are working with, I can only play the role of speculative optimist.)
Tested with $ sed --version | head -1 sed (GNU sed) 4.7 $ dpkg-query -l sed # check that it is installed Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-==============-============-============-================================================= ii sed 4.7-1 amd64 GNU stream editor for filtering/transforming text -- Hackers are free people. They are like artists. If they are in a good mood, they get up in the morning and begin painting their pictures. -- Vladimir Putin