On Mar 14, 2006, at 12:35 PM, Jason Davies wrote:
I've been making some tests with grep but I just can't find the
solution. I've never used it, so it may be quite simple or maybe it
just can't be done with grep... ;)
sounds like one of those 'easier in Perl' but I don't know if grep
can add numbers like that. A scripted grep search might be the
answer, using a variable which you add one to on each circuit.
I don't have time to write it but if you make a start, I'll chip in:-)
I would use different logic, if you're just trying to insert these into
a given file.
place the necessary numbers in your file:
01
02
03
04
05
06
... etc
And then:
Find:
^(\d+)$
Replace:
<div class="gal-mini"><a href="img/temp_05_06/tfr-\1.jpg"><img
class="gen-img" src="img/temp_05_06/tfr-\1-th.jpg" /></a></div>
If the 'temp_05_06' bit changes, you could use a second captured string
on each line (tab seperated, or similar), so you have two things
changing
each time.
-----
Joe Hourcle
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <[EMAIL PROTECTED]>