Skip to main content
jaimep70636492
Participant
October 8, 2020
Question

Remove leading zeros from filenames

  • October 8, 2020
  • 3 replies
  • 934 views

How can I use string substitution to batch remove leading zeros from filenames? For example, I want to change 2020_001_002 to 2020_1_2. 

This topic has been closed for replies.

3 replies

Stephen Marsh
Community Expert
Community Expert
October 9, 2020

In it's simplest form, one does not even need a regular expression, a simple find/replace for 00 is all that is required.

 

 

Of course, if there are double zero digits in the filename that do need to be retained, then you need to introduce a regular expression based pattern match.

Legend
October 8, 2020

You can use regular expressions. /00/g would find all instances of "00" in files.

 

https://www.regular-expressions.info/

gary_sc
Community Expert
Community Expert
October 8, 2020

Hi Jaime,

 

Within Bridge I do not think so. However, if you are on a Mac you can use the application "A Better Finder Rename" which can use Regular Expressions.

 

see: https://medium.com/@johnlreed/a-better-finder-rename-and-regular-expressions-7f0b9645a002

 

Not sure it helps you but it might get your thoughts going