Rename files based on text file with list of names

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
mihalc
Junior Member
Junior Member
Posts: 5
Joined: 2014-08-18, 16:46 UTC

Rename files based on text file with list of names

Post by *mihalc »

I often need to rename large number of files based on text file. Names are generated automatically. The only problem I can't get files' extensions. Is it possible to rename files based on .txt and keep original extensions?
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

 
Hi and welcome.


I don't understood the extensions problem.

Post five till ten examples please:

Origin name.ext > New Name.ext
Origin name.ext > New Name.ext
Origin name.ext > New Name.ext
Origin name.ext > New Name.ext




And post example how your "text file" is structured.



.
mihalc
Junior Member
Junior Member
Posts: 5
Joined: 2014-08-18, 16:46 UTC

Post by *mihalc »

There are no extensions in my text file.... that is the problem. My .txt is smth. like this:

New Name
New Name
New Name
New Name
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

And what is the extension to add?



 
mihalc
Junior Member
Junior Member
Posts: 5
Joined: 2014-08-18, 16:46 UTC

Post by *mihalc »

They are always different: doc, docx, xls, xlsx...
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

Next worm pulling out of nose (if there is this word in English too :P )


And how would you adjust which line/name from text file fit on which file from list?





 
mihalc
Junior Member
Junior Member
Posts: 5
Joined: 2014-08-18, 16:46 UTC

Post by *mihalc »

According to their order....lines' order is always equivalent to files' order.
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

rename file from list but keep origin extension

Post by *Stefan2 »

Really, well...


Do you use a good editor with column selection mode, or a spread sheet app?

If so, here are two ways:


(be sure to have a recent backup)



1.)
If you have a text editor with column mode, you can just collect the extensions
as shown below and paste them behind the file name in your list.




2.)
If you want to utilze a spread sheet app, do this steps:

- go to your folder

- open a DOS Box
- enter this command:

for /F "tokens=*" %F in ('dir /B /A-D') Do @ECHO %~xF >> C:\Temp\_Extensions.txt


- open spread sheet

- in Column "B" copy content from your list
- in Column "C" paste content from _Extensions.txt

- in Column "A" type =B1&C1
- Paste "A1" formula down the columns

Now you should have
-------A-------- -------B--- ----C--------
"new name.oldext" "new name" ".oldext"


- create a new text file in C:\temp
- select whole Column "A"
- paste into text file
- save text file


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


Then for either way utilize MUT and press button "Load names from file..." and chose the file from C:\temp or your file list.


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


Another way is to use den4b ReNamers, which have this feature implemented.


 
mihalc
Junior Member
Junior Member
Posts: 5
Joined: 2014-08-18, 16:46 UTC

Post by *mihalc »

Thanks... I've found I can do it with Advanced Renamer free utility.
Post Reply