To sum up I ended up working on 115 files (static html, a lot of copy/paste,
and cp to make them) To make the all work in one directory (to reduce disk
space, and bandwidth) It took a lot of search/replace, but things like
find ./*.html -type f | xargs perl -p -i.orig -e \
's/alt\=\"([^\"]*)\"/alt="$1" title="$1"/gi'
made short work of a lot of editing! I ended up using it to replace
backgrounds, change directory structure in the html, and add the title
tags... (I also made some mistakes and had to fix them with another long
command line (and managed to sucessfully fix many goofs!)
so... If you need a script to go and make title tags for your html using the
existing alt tags...
find ./*.html -type f | xargs perl -p -i -e \ 'BEGIN {undef $/}
s/alt\=\"([^\"]*)\"/alt="$1" title="$1"/gis'
will do it nicely, Infact, I saved it in my /usr/bin directory as a2t, and
all I have to do is type ./a2t in any directory and it does them all :)
If you change it to:
find ./*tml -type f | xargs perl -p -i -e \ 'BEGIN {undef $/}
s/alt\=\"([^\"]*)\"/alt="$1" title="$1"/gis'
it should get .shtml files too. It would be nice if it did a condition
statement to look for single character alt tags (such as * and o and - and
all the other single characters that people use for bullet image alt tags,
'cause we dont need to see the word bullet, or * when we move the mouse over
an image!
115 html files in 4 directorys that took up about 5 megs, now fits in one
directory, and takes up 1/4 the space it used to!
Note to kbob: man that -i.orig saved my ass a few times! Its a good thing I
know how to rename .html.orig .html *.html.orig :)
Jamie
Sometime just before Tuesday 30 April 2002 11:30 pm Bob Miller Wrote
about:[EUG-LUG:2495] Re: Regular Expressions
: Grigsby, Garl wrote:
: > Speaking of regular expressions.... Anybody have a good web based
: > reference on regular expressions? I plan on buying O'Reilly's Mastering
: > Regular Expressions but am cash poor at the moment and I need to figure
: > this stuff out.....
:
: The Perl distribution includes a man page on the subject. "man
: perlre" or "perldoc perlre" will show it.
:
: I found a good Python-oriented HOWTO here.
:
: http://py-howto.sourceforge.net/regex/regex.html
: Regular Expression HOWTO
: A.M.Kuchling
:
: And of course the man pages for {,e,f}grep and sed are appropriate if
: you're using those.
:
: The POSIX regex man page will put you to sleep, but it's complete
: and accurate. "man 7 regex".
:
: The HOWTO is probably the best starting place for a beginner.
--
for setting/changing your eug-lug mailinglist subscription use this website:
http://wWw.RockSolidNetworks.com/eug-lug.html
no microsoft products were used to produce this message.