Re: HTML guru to the rescue?

Subject: Re: HTML guru to the rescue?
From: Sandy Harris <sandy -at- storm -dot- ca>
To: "TECHWR-L" <techwr-l -at- lists -dot- raycomm -dot- com>
Date: Thu, 28 Jun 2001 15:34:30 -0400

Chris Gooch wrote:

> Thanks for all the help guys. It looks like the concensus
> is there's no way to do this without swapping &lt for <
> and so on ---- as I'm trying to do this in a script, this is
> a pain --- more sed required, jeez. sed makes my head hurt :-(

If you can do the conversion before the data reaches your HTML
file, just put these two lines:

s/>/\&gt;/g
s/</\&lt;/g

plus any others you may want, like this one to recode quotes:

s/"/\&quot;/g

in a file named, say, 'sedscript' and do:

sed -f sedscript < infile > outfile

to do a single file conversion. For multiple files, put that
inside a shell loop, something like:

for i in chapter.*
do
sed -f sedscript < $i > $i.new
done

If the data's already in the HTML file, then this is a tricky
task for sed. You need to be selective so you don't change <
and > in HTML tags. This is possible, but tricky.

I know sed well, consider it an old friend, but for this I'd
use an interactive editor. e.g. I've done it with Wordpad's
replace command. Just go through the whole file clicking
'replace' for the text < or > characters and 'next' to bypass
the ones that are in HTML tags. Takes a while, but does the
job.

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

*** Deva(tm) Tools for Dreamweaver and Deva(tm) Search ***
Build Contents, Indexes, and Search for Web Sites and Help Systems
Available now at http://www.devahelp.com or info -at- devahelp -dot- com

Sponsored by Cub Lea, specialist in low-cost outsourced development
and documentation. Overload and time-sensitive jobs at exceptional
rates. Unique free gifts for all visitors to http://www.cublea.com

---
You are currently subscribed to techwr-l as: archive -at- raycomm -dot- com
To unsubscribe send a blank email to leave-techwr-l-obscured -at- lists -dot- raycomm -dot- com
Send administrative questions to ejray -at- raycomm -dot- com -dot- Visit
http://www.raycomm.com/techwhirl/ for more resources and info.


References:
RE: HTML guru to the rescue?: From: Chris Gooch

Previous by Author: Re: The Technical Writing Field
Next by Author: RE: Interviews (5 Year Question)
Previous by Thread: RE: HTML guru to the rescue?
Next by Thread: Re: HTML guru to the rescue?


What this post helpful? Share it with friends and colleagues:


Sponsored Ads