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.
Re: Looking for a program to help with a tedious job
Subject:Re: Looking for a program to help with a tedious job From:Sandy Harris <sandy -at- storm -dot- ca> To:"TECHWR-L" <techwr-l -at- lists -dot- raycomm -dot- com> Date:Mon, 05 Feb 2001 14:32:55 -0500
Marguerite Krupp wrote:
> OK, I've figured out how to rename all the source files with little pain.
> The biggie is changing the names in the Frame source files. I am thinking in
> terms of some kind of script that would open each file, search for the "old"
> imported file name, replace that with the "new" imported file name, save and
> close the file, go on to the next, etc., until it reached the end of the
> book. ..
> Can anyone suggest a tool, maybe shareware (?) that will do this?
This is the sort of task where Unix shines. Save the files in Frame's MIF format
and the rest is trivial with Unix text-manipulation tools. When I taught intro
to Unix years ago, this problem was a classroom exercise.
My suggestion would be to grab a set of free Unix-like tools for NT:
or just transfer the data to a Unix box. Presumably Cisco has a few :-)
Once you've done that, you could do the rest with sed(1), awk(1) or perl(1). The
(1)'s mean these are user commands documented in Section 1 of the manual. You read
the man pages with commands like "man 1 sed", or just "man sed".
I'd use sed(1). The program would look something like:
# loop through all MIF files
for i in *.mif
# read the current MIF file ($i)
# edit with sed, save results in temporary file
sed -f sedscript < $i > temp
# replace original with edited version
mv temp $i
and sedscript would be a large file alomg the lines of:
s/old name 1/New Name 1.0/
s/xyzzy/Some other string/
These commands are just s for substitute, replacing every occurrence of
"old name 1" with "New Name 1.0", and so on.
Develop HTML-Based Help with Macromedia Dreamweaver 4 ($100 STC Discount)
**WEST COAST LOCATIONS** San Jose (Mar 1-2), San Francisco (Apr 16-17) http://www.weisner.com/training/dreamweaver_help.htm or 800-646-9989.
Sponsored by DigiPub Solutions Corp, producers of PDF 2001
Conference East, June 4-5, Baltimore/Washington D.C. area. http://www.pdfconference.com or toll-free 877/278-2131.
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.