Copy link to clipboard
Copied
Hey folks.
I have big data base with specific file names.
Example
w=xxx-sometext-sometext-sometext-sometext_.tif
w=xxxxxx-sometext-sometext-sometext-sometext_.tif
Numbers of x are different. I want to only change the first - to _ like below
w=xxx_sometext-sometext-sometext-sometext_.tif
How to do this?
Copy link to clipboard
Copied
Assuming the file names only have numbers at the beginning, you can use this regex to match only the dash after a number:
(?<=\d\d)-
You can use this in the batch rename tool with the string substitution option and the "use regular expression" box checked.
If your filenames can also have numbers in the middle and you don't want to replace the dashes after those, it's a bit more complicated because in Regex, lookbehinds (something that looks backwards in the string without selecting those characters) need to have a fixed length. So, you're going to need multiple instances of this string substitution, each with a different number of "\d"s in them - these match individual digits.
// matches only a dash that comes after the start of the string followed by 1 digit
(?<=\A\d)-
// matches only a dash that comes after the start of the string followed by 2 digits
(?<=\A\d\d)-
// matches only a dash that comes after the start of the string followed by 3 digits
(?<=\A\d\d\d)-
// etc...
Hope this helps!
Copy link to clipboard
Copied
Find more inspiration, events, and resources on the new Adobe Community
Explore Now