You'd need a textfactory with 10 replace steps, one for each number:

search
(\S*)1(\S*?)\.tif
replace
\1A\2.tif

search
(\S*)2(\S*?)\.tif
replace
\1B\2.tif

... and so on. \S finds every none-space character. Thus, if you have file 
names with spaces in them you'll run into problems.
Beware that each search only finds a single character. So you would have to do 
the first search four times to convert 1111.tif to AAAA.tif. Just execute the 
final textfactory again and again until it yields no further results.

This is quite a crude approach but should work (nethertheless making backups 
before applying the change wouldn't be a bad idea). Maybe some Perl or Python 
wizard will come up with a more elegant scripted solution.

Regards, Roland

Am 21.11.2010 um 21:45 schrieb Rene:

> Hi all,
> 
> I've tried to do this myself, but I'm running into a wall.
> 
> I need to create a grep find and replace to change all "numbers.tif"
> into "letters.tif".
> 
> The text file has a few hundred "events" like this one:
> 
> 001  0000     V     C        00:02:19:18 00:02:25:07 00:02:19:18
> 00:02:25:07
> * FROM CLIP NAME:  1234.tif
> * FROM CLIP IS A STILL
> 
> After the replacing, it should read:
> 
> 001  0000     V     C        00:02:19:18 00:02:25:07 00:02:19:18
> 00:02:25:07
> * FROM CLIP NAME:  ABCD.tif
> * FROM CLIP IS A STILL
> 
> I've been trying to get this done with search strings like (0?)\.tif
> and
> replacement strings like (A)\.tif
> 
> as you can tell, I'm not very proficient with grep, the last time I
> used it may
> well be 15 years ago…
> 
> There must be a more simple way to turn e.g. 0000.tif into AAAA.tif
> (etc.)
> while leaving all other numbers alone. I've already renamed all
> the .tif files
> that this text file refers to using Name Mangler.
> 
> Is there anyone who can help me write the grep search/replace or a
> BBEdit text factory?
> 
> Thanks in advance!!!
> 
> -- 
> You received this message because you are subscribed to the 
> "BBEdit Talk" discussion group on Google Groups.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> <http://groups.google.com/group/bbedit?hl=en>
> If you have a feature request or would like to report a problem, 
> please email "[email protected]" rather than posting to the group.
> Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

Reply via email to