Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Remove leading zeros from filenames

New Here ,
Oct 08, 2020 Oct 08, 2020

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. 

TOPICS
Batch , How to , Scripting
729
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 08, 2020 Oct 08, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 08, 2020 Oct 08, 2020

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

 

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 09, 2020 Oct 09, 2020
LATEST

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

 

noregexrequired.png

 

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines