TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
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 < 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/>/\>/g
s/</\</g
plus any others you may want, like this one to recode quotes:
s/"/\"/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.