remove right-hand side of file name

A swapping-ground for Regular Expression syntax

remove right-hand side of file name

Postby BEAST » Tue Dec 06, 2016 12:10 am

Looked at a few of the posts here but couldn't figure out the regexp... Could someone please help?

current file name: "A-001 - General Notes Symbols Abbreviations.pdf-M-0-0-A-001 - General Notes Symbols Abbreviations" (the extension is pdf).

needed file name : "A-001-GeneralNotesSymbolsAbbreviations"

requirements (1) find and remove from ".pdf" to the right (2) remove all spaces, (3) ignore file extension.
BEAST
 
Posts: 2
Joined: Tue Dec 06, 2016 12:04 am

Re: remove right-hand side of file name

Postby therube » Tue Dec 06, 2016 1:06 am

(I'm not so good with regex, so test...)


Renaming Options: -> Ignore --> File Extensions


1:RegEx
Code: Select all
Match: (.*)(\.pdf.*)
Replace: \1


3:Replace
Code: Select all
Replace: {space}
With: {don't enter anything}
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm

Re: remove right-hand side of file name

Postby BEAST » Tue Dec 06, 2016 2:39 pm

Thanks TheRube! The light is coming on about Regular Expressions - the parentheticals make the different parts.
BEAST
 
Posts: 2
Joined: Tue Dec 06, 2016 12:04 am


Return to Regular Expressions