Removing and replacing part of a filename.

A swapping-ground for Regular Expression syntax

Removing and replacing part of a filename.

Postby GregRT » Thu Apr 13, 2017 5:29 pm

Just ran across this utility and board, great support guys.
I have thousands of files that need to be renamed, the format is Pattern name_Sku-numbers_dimention.s.JPG . Example Selenite_2VSX-06_68x64.14.jpg

The first part of the name is a pattern name of some sorts. Then an _ the SKU number followed buy another _. Then dimentions like 66x35.5cm.jpg.

I want all these to be formatted Pattern Name_SKU numbers_FullRepeat.jpg . example Selenite_2VSX-06_FR.jpb

Thanks in advance for your help.

Greg
GregRT
 
Posts: 1
Joined: Thu Apr 13, 2017 4:02 pm

Re: Removing and replacing part of a filename.

Postby therube » Fri Apr 14, 2017 1:31 am

Check & test ;-).

1:RegEx
Code: Select all
Match:  (.*?_)(.*?_)
Replace:  \1\2FR
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm


Return to Regular Expressions