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.
Please e-mail responses directly to me - I'll make solutions available to
interested subscribers.
For all of the html files in a directory, I need to get the contents of the
<title> tag copied into an <h1> tag. Right now I'm looking at using awk to
try to do this. Empty <h1> tags exist in the html files.
I have the following right now:
ls /htmldir/*.html > /tmp/html.list
for file in `cat /tmp/html.list`
do
awk '/<\/title>/ { IFS="</?title>"; field = $2; IFS=" " }
/<h1> *<\/h1>/ { print $1 field $2 }
{print}' $file
done
However this script only creates an empty <h1> tag and moves everything into
one file.
I'm not tied to using awk, I can use perl or other scripting tool if there
is a better way. Thanks for any suggestions - please e-mail me directly as
this is probably not of wide-ranging techwr-l interest.
The technical writing problem this is intended to solve: a spec author has a
bunch of tables published at html, which are titled but the title does not
appear in the body of the html file.
Thanks,
................................................................
Michael Collier, Technical Writer Office: N636
Information Systems Laboratory http://isl.arlut.utexas.edu/
Applied Research Laboratories: The University of Texas at Austin
Voice: 512-835-3408 mailto:mcollier -at- arlut -dot- utexas -dot- edu
................................................................
A landmark hotel, one of America's most beautiful cities, and
three and a half days of immersion in the state of the art:
IPCC 01, Oct. 24-27 in Santa Fe. http://ieeepcs.org/2001/
+++ Miramo -- Database/XML publishing automation. See us at +++
+++ Seybold SFO, Sept. 25-27, in the Adobe Partners Pavilion +++
+++ More info: http://www.axialinfo.comhttp://www.miramo.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.