I like it, thanks
chromatic. May I throw a slight curve in the fairway?
A quick dig in
The Owl leads me to think something like this will match reference
any image of alphanumeric name. How close am I?
perl -i.bak -pe 's!(img src=")(\w+?\.(gif|jpg|jpeg|png)")!$1/Images/$2!g' *.html
Update: The above one-liner was tweaked, and now works.
Changes this:
<img src="12345.gif">
<img src="1b3e5.jpg">
<img src="1B3Df.jpeg">
<img src="abcde.png">
To this:
<img src="/Images/12345.gif">
<img src="/Images/1b3e5.jpg">
<img src="/Images/1B3D5.jpeg">
<img src="/Images/abcde.png">
And saves original files as ".bak".
cheers,
Don
striving for Perl Adept
(it's pronounced "why-bick")
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.