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

Remove leading zeros from filenames

New Here ,
Oct 08, 2020 Oct 08, 2020

Copy link to clipboard

Copied

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

Views

357

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

 

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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