in reply to need help on SED

Instead of using sed, go to CPAN and check out my module Text-ASED, the Advanced Stream EDitor.

It allowes you to edit files without the cost of invoking an external process. It's particularly useful if you need to perform the same set of edits on several files, even more so if you perform mostly-the-same edits, with minor variations, on various files.