[plug] text processing

Graham, Alan A. Alan.Graham at woodside.com.au
Mon Dec 9 16:39:16 WST 2002


!#/bin/ksh
# I can't test this cos I'm on an NT box :-(
# I know korn shell, but I understand bash can run ksh scripts
#

for $file in $(ls ../docs/*doc)
do
	$file_out=${$file%doc}html
	wvText < ../docs.$file | txt2html > ../html/$file_out
done

I can't remember if the output from straight ls looks like ../doc/one.doc or
just one.doc.  The code assumes one.doc.  And I say again, I can't test this
goes I don't have access to a real OS at this site.

Alan


> -----Original Message-----
> From:	Sol [SMTP:sol at autonomon.net]
> Sent:	Monday, 9 December 2002 16:24
> To:	plug at plug.linux.org.au
> Subject:	[plug] text processing
> 
> Hi PLUG,
> 
> I have a bunch of M$ Word files that in a directory that I want to clean
> up 
> and output to another empty directory as HTML. I've been doing everything
> the 
> slow way using command line tools, but I'm sure that it can all be done
> with 
> a single command. I'm using wvText and txt2html. I want to pipe all the
> files 
> in the directory in order through wvText into the empty directory and then
> 
> pass everything in that directory through txt2html.
> 
> If I've got these files: one.doc, two.doc and three.doc in ../docs/ and
> want 
> them to end up as HTML in ../html/ as one.html, two.html and three.html,
> how 
> can I do this with a single command?
> 
> Thanks,
> sol
> 
> 
> 
> -- 
> This email was received from the Internet.  If this email is unsolicited,
> non-business related, inappropriate or spam, please forward it to
> spamfilter at woodside.com.au



More information about the plug mailing list