Skip to main content
Inspiring
October 2, 2020
Answered

How to remove first 5 characters in file name using batch rename

  • October 2, 2020
  • 3 replies
  • 9479 views

I have a series of files that are named like: 0001 IMG_5564

I would like to remove the first 5 digits of the file name (0001 /4 numers and a space), so I am left with IMG_5564.jpg

Tried a bunch of combinations, but can't seem to make it work. Suggestions?

 

Thank you!

~ Kathleen

This topic has been closed for replies.
Correct answer kathleen08

I just needed to keep searching!

The answer is a string substitution of:

^.{5}

 

3 replies

Participant
October 19, 2022

adobe as a brief explanation on their site of regular expressions as well, linked below. i needed to remove "-proof" from about 41,000 files from a previous designer at my job to adhere to a better, more logical, naming scheme. i ended up using the simple expression " \-(proof) ". that took me about 15 minutes to figure out because I've never used regular expressions, so i hope that can help someone cut a corner.

 

https://helpx.adobe.com/coldfusion/developing-applications/the-cfml-programming-language/using-regular-expressions-in-functions/regular-expression-syntax.html

patrickh27764550
Inspiring
October 13, 2022

This just saved me several hours of work.  TYVM

 

I have over 3000 pictures from my holiday and the file names started with a sequence number followed by date, time, and description.  I had to insert t pictures in the low 0500s.

 

I used this to remove the sequence number.  The date and time kept them in the right order.  Then I added in the new sequence number.

 

Is there a list of other codes similar to this?  It could be handy in the future.

Stephen Marsh
Community Expert
Community Expert
October 13, 2022

@patrickh27764550 – Regular Expressions (sometimes called GREP, RegEx, RegExp etc) are a whole "language", they can be generic or very much case-dependent.

 

One of many resources:

 

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

 

patrickh27764550
Inspiring
October 15, 2022

Awesome!!!  This might be worth studying up on.  TY

kathleen08AuthorCorrect answer
Inspiring
October 2, 2020

I just needed to keep searching!

The answer is a string substitution of:

^.{5}

 

Stephen Marsh
Community Expert
Community Expert
October 2, 2020

Glad you worked it out!

 

There are many variations...

 

^.+\s

^\d+\s

^\d{4}\s

 

trashcaneron
Inspiring
July 23, 2022

Yes! Make sure "regular expression" is checked