Newbie Question (removing files’ previous extension)

A swapping-ground for Regular Expression syntax

Newbie Question (removing files’ previous extension)

Postby ArshaBRU » Fri Jun 11, 2010 11:01 am

Hi

I’d like to rename files with the pattern like “03. Knockin' On Heaven's Door.wma.mp3” to “03. Knockin' On Heaven's Door.mp3”. Roughly speaking I need to remove files’ previous extension. All files have extension '.mp3', other parts may vary.

What would be the proper regular expression?

I prefer using command prompt and working with all files and subdirectories. If you can provide me the command line arguments I would be doubly thankful!

Regards
ArshaBRU
 
Posts: 3
Joined: Fri Jun 11, 2010 10:40 am

Re: Newbie Question (removing files’ previous extension)

Postby Stefan » Sat Jun 12, 2010 8:26 pm

ArshaBRU wrote:Hi

I’d like to rename files with the pattern like
“03. Knockin' On Heaven's Door.wma.mp3” to
“03. Knockin' On Heaven's Door.mp3”.

Roughly speaking I need to remove files’ previous extension. All files have extension '.mp3', other parts may vary.

What would be the proper regular expression?

I prefer using command prompt and working with all files and subdirectories.
If you can provide me the command line arguments I would be doubly thankful!

Regards

You can use

two times
Extension(11) [Remove]
followed by one time
Extension(11) [Extra][mp3]



or use
Remove(5) Last n [ 4]



or one time
Repl.(3)
Replace: ".wma"
With: ""
(OK, not for you "other parts may vary.")

or RegEx(1)
Match: (.+)\.wma
Repla: \1
OK, not for you "other parts may vary.". So use instead:
Match: (.+)\....$
Repla: \1



You can check [X]Subfolders at Selections(12)


For command line use you can check out BRC:

E:\a\Renamers\BulkRenameUtilitie\own\BRC tests>..\..\brc /removelastn:4 /Pattern:"*.mp3"
Processing Folder E:\a\Renamers\BulkRenameUtilitie\own\BRC tests\
Filename 03. Knockin' On Heaven's Door.wma.mp3 would be renamed to 03. Knockin' On Heaven's Door.mp3
Filename 03. Knockin' On TWO Extensions.wma.mp3 would be renamed to 03. Knockin' On TWO Extensions.mp3


Check out the help for more.


.
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: Newbie Question (removing files’ previous extension)

Postby ArshaBRU » Sun Jun 13, 2010 6:08 pm

OK, I succeeded with the graphics user interface. However I can't manage to do it with "Bulk Rename Command 1.3.3" Here is the output:


P:\P->brc32 /INCLH /INCLR /INCLS /RECURSIVE /REGEXP:(.+)\....$:\1

Code: Select all
Processing Folder P:\P-\
Filename 03. Knockin' On Heaven's Door.mp3 requires no changes
Filename BRC32.exe requires no changes


Processing Folder P:\P-\mp1\
Filename 03. Knockin' On Heaven's Door.mp3.mp3 would be renamed to 03. Knockin' On Heaven's Door.mp3


Processing Folder P:\P-\mp1\Queen\
Filename DEAR FRIENDS.MP3.mp3 would be renamed to DEAR FRIENDS.mp3
Filename Queen requires no changes
Filename mp1 requires no changes


Processing Folder P:\P-\mp2\
Filename 03. Knockin' On Heaven's Door.mp3.mp3 would be renamed to 03. Knockin' On Heaven's Door.mp3


Processing Folder P:\P-\mp2\A Gift Of Love\
Filename ALWAYS IN MY HEART   PERFORMD BY  TEVIN CAMPBELL.MP3.mp3 would be renamed to ALWAYS IN MY HEART   PERFORMD BY  TEVIN CAMPBELL.mp3


Processing Folder P:\P-\mp2\A Gift Of Love\qq\
Filename ALL OF MY LIFE   PERFORMD BY PHILL COLLINS.MP3.mp3 would be renamed to ALL OF MY LIFE   PERFORMD BY PHILL COLLINS.mp3
Filename qq requires no changes
Filename A Gift Of Love requires no changes
Filename mp2 requires no changes
Filename P-.rar requires no changes
Filename pcre.dll requires no changes


It says "Filename 03. Knockin' On Heaven's Door.mp3.mp3 would be renamed to 03. Knockin' On Heaven's Door.mp3" and so on ..., but I'm experiencing no change at all! Should it be a bug?

Arsha
ArshaBRU
 
Posts: 3
Joined: Fri Jun 11, 2010 10:40 am

Re: Newbie Question (removing files’ previous extension)

Postby Stefan » Sun Jun 13, 2010 6:54 pm

I think the bug is sitting in front of the pc... not reading the help completely?


Help wrote:Performing the Rename

Ok, so you've specified all your arguments, but nothing's happening. Well, you need to pass one last argument, and this is described below.
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: Newbie Question (removing files’ previous extension)

Postby ArshaBRU » Mon Jun 14, 2010 5:03 am

Thanks. I read that by I don't know how I forgot that. :)
ArshaBRU
 
Posts: 3
Joined: Fri Jun 11, 2010 10:40 am


Return to Regular Expressions