Remove things after a number

A swapping-ground for Regular Expression syntax

Remove things after a number

Postby jbeaty1888 » Sat Oct 13, 2018 7:00 am

Hello all. I have been trying to figure this out. I have files named:
Avengers 001 Awaken the Thunder.cbr
Avengers 002 First Blood.cbr
But to help sort then in comic rack, i need them to be
Avengers 001.cbr
Avengers 002.cbr

How can i remove everything between the number and the file extension? I have SO many.
jbeaty1888
 
Posts: 2
Joined: Sat Oct 13, 2018 6:52 am

Re: Remove things after a number

Postby therube » Sat Oct 13, 2018 6:11 pm

Very basic, so certainly doesn't take into account all situations, so you want to check what you're getting before you actually rename... ;-)


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


Like:
Code: Select all
Apollo 440 - 1. Stay Frosty.m4a
Apollo 440 - 2. The Future's What It Used To Be.m4a
Apollo 440 - 3. Smoke & Mirrors.m4a

->
Code: Select all
Apollo 440.m4a
Apollo 440.m4a
Apollo 440.m4a


Code: Select all
[Enigma] 101 - Encounters.mp3
[Enigma] 102 - Seven Lives.mp3
[Enigma] 103 - Touchness.mp3

->
Code: Select all
[Enigma] 101.mp3
[Enigma] 102.mp3
[Enigma] 103.mp3


;-).
therube
 
Posts: 1317
Joined: Mon Jan 18, 2016 6:23 pm

Re: Remove things after a number

Postby jbeaty1888 » Sat Oct 13, 2018 6:21 pm

Omg. Thank you so much. I am still learning on this thing. That worked perfectly. Thank you
jbeaty1888
 
Posts: 2
Joined: Sat Oct 13, 2018 6:52 am


Return to Regular Expressions