Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

sed - substituting a text block with a line

0 views
Skip to first unread message

sunil

unread,
Nov 10, 2003, 9:14:20 PM11/10/03
to
I'm trying to use the substition functions
of sed to replace a block of text with a
single line.

Specifically, I want to take remove style
sheets defined in the head of a html document,
and replace it with a link to an external style
sheet.

I've been discovering sed, but it multiline
commands are at the moment beyond my comprehension.

There is a lot of useful information on sed on
the net, but it seems to be oriented towards
operating on single lines. I need a solution
that removes a block, and replaces it with a line.

Can anyone help?
Thank you

Noi

unread,
Nov 12, 2003, 5:27:39 PM11/12/03
to

Try this site http://www.cornerstonemag.com/sed/

Would placing sed commands into a scriptfile help?
>$ sed -f scriptfile inputfile

Or ?
>$ sed -e "/^css/,/^\/css/c this block of text" inputfile

0 new messages