Multi Renamed My Extensions Away

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Alonzo Mosley
Junior Member
Junior Member
Posts: 61
Joined: 2018-03-28, 20:13 UTC

Multi Renamed My Extensions Away

Post by *Alonzo Mosley »

I had a bunch of files with useless info between a date in the file name and their extension. In a bunch of directories.

So I:
- Searched for "201" (all files were from 2011-2018)
- Added all the files to the Listbox
- Multirenamed, searching for "201*" and replacing with a blank

It was successful - it took away all the crap. But it also erased the file extension!

I closed Total Commander before I realized this, so Undo is off the table.

Any easy way to go back and re-add file extensions (They're all docx)?. I don't have a common thing, I don't think, to search for.
Alonzo Mosley
Junior Member
Junior Member
Posts: 61
Joined: 2018-03-28, 20:13 UTC

Post by *Alonzo Mosley »

Actually almost every filename ends with three digits ("0xx"). Can I search for two numbered wildcards and add a ".docx", WITHOUT changing the numbers?
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1013
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR »

Search for

Code: Select all

0\d\d$
with "RegEx" checked,

feed to Listbox,

Multirename with Extension:

Code: Select all

[E].docx
and Search & Replace: ".." with "."

just in case there are dots in your file names.
Alonzo Mosley
Junior Member
Junior Member
Posts: 61
Joined: 2018-03-28, 20:13 UTC

Post by *Alonzo Mosley »

Effin' A, bubba! Worked like a charm! Thank you!

If you have a moment, would love for you to explain what we did there.

More importantly, what could I have done to avoid this in the future? (I'm guessing if my "Replace with" had the ".docx" in it?)

Thank you!
User avatar
Stefan2
Power Member
Power Member
Posts: 4158
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

> it also erased the file extension!
Note the []E checkbox next time. Press F1 key in MRT to read more.

>so Undo is off the table
Last Undo is still available after closing, just launch the MRT again and try Undo.

>Multirename with extension [E].docx
Just 'docx' would be enough in Extension box,

>Search for 0\d\d$
>Replace ".." with "."
There can't be trailing dots, as this is not allowed, and also your RegEx wouldn't match them, as you search for a digit right at the end ('$').



 
Alonzo Mosley
Junior Member
Junior Member
Posts: 61
Joined: 2018-03-28, 20:13 UTC

Post by *Alonzo Mosley »

Yeah I guess I'm still not clear what the "0\d\d$" did. Willl read more in F1 to figure out. Thanks!
User avatar
Stefan2
Power Member
Power Member
Posts: 4158
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

Alonzo Mosley wrote:...
. Willl read more in F1 to figure out. Thanks!
That's cool!
Alonzo Mosley wrote:... I'm still not clear what the "0\d\d$" did. ...
The '0' is a literal char, just a zero digit.
Alonzo Mosley"> Actually almost every filename ends with three digits ("0xx"). ...


\d and $ are noted in the help.

Tip: open the MRT, then press F1 key. Next click at the text "regular expressions." to open the regex help.



Still unclear? Just ask.


 
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1013
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR »

Stefan2 wrote:>Multirename with extension [E].docx
Just 'docx' would be enough in Extension box,

>Replace ".." with "."
There can't be trailing dots, as this is not allowed, and also your RegEx wouldn't match them, as you search for a digit right at the end ('$').
 
Not if there was a file "File.001.docx" that is now "File.001"

[E].docx and ".." -> "." is meant to be used in one go.
Alonzo Mosley
Junior Member
Junior Member
Posts: 61
Joined: 2018-03-28, 20:13 UTC

Post by *Alonzo Mosley »

Not to be completely dense, but I'm trying to learn how to do this right. And I'll confess the F1 help is confusing me more!

I grabbed a bunch of files and fed them into the MultiRename tool.

If I do the "Search for: '201*'" and Replace blank, no matter what it wants to erase the [dot]extension...
I have checked and unchecked "[E]" under the Replace box. I have added ".docx" to the "Extension" field and also "[E]" into the Extension field.

(I know I can rename '201*' with '.docx', but what would I do if they weren't all the same file type?)


Sorry to be a pest!
User avatar
Stefan2
Power Member
Power Member
Posts: 4158
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

 

If you un-check the "[_]E"-option on the search and replace part of MRT,
your search and replace is only done on the base name part, ignoring the extension.

(In MRT press F1 key and read below of "Search & Replace" at the first "[E]" occurrence)



TEST

FROM:
2011-01-02 Test ABC.docx
2012-02-03 Test ABCD.PDF
2013-03-04 Test ABCDE.TXT

TO:
.docx
.PDF
.TXT

USE:
Name: [N]
Extension: [E]
Search: 201*
Replace: <clear>
[_][E]

- - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

FROM:
2011-01-02 Test ABC.docx
2012-02-03 Test ABCD.PDF
2013-03-04 Test ABCDE.TXT

TO:




USE:
Name: [N]
Extension: [E]
Search: 201*
Replace: <clear>
[X][E]


- - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -


BTW, if you just want to remove the base name part, use
Name:
Extension: [E]
Search:
Replace:


Or to enter something new in one go:
Name: Vacation 2018 - [C:2]
Extension: [E]
Search:
Replace:



Still unclear? Just ask.
Best post a few before/after example names.


 
Alonzo Mosley
Junior Member
Junior Member
Posts: 61
Joined: 2018-03-28, 20:13 UTC

Post by *Alonzo Mosley »

OK, thank you and I hate you! (JK)

I tried that half a dozen times, didn't work. So I posted.

And I went back after reading your explanation (thank you), and, without changing anything, it worked perfectly. (ugh)

Anyway, bookmarked this thread for next time. Thanks!
Post Reply