[ILUG] Re: sed question

Emen Zhao emenzhaowork at gmail.com
Fri Aug 15 05:27:22 IST 2008


Hello Marcus,

Try if this helps. It assumes all elements are missing ending tag, and
doesn't support embedded tags. If that's the case, a more sophisticated
script might be needed.

perl -0777 -wpl -e 's{(<(\w+).*?>.*?)(?=\s*(<\w|\z))}{$1. " </$2>"}esg'

Hope this helps.

Thanks,
--Emen



More information about the ILUG mailing list