Overwriting Files With Different Names

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
GraemeC
Junior Member
Junior Member
Posts: 25
Joined: 2009-08-27, 14:11 UTC

Overwriting Files With Different Names

Post by *GraemeC »

I've got a project I hope can be done easier in Total Commander, but not sure the best way to go about it.

I have a series of webpages of captioned photos, and want to replace the old photos with newer, better, similar ones. The problem is that the old photos have nonstandard names, like 0998056812.jpg, as they were pulled off of a site that numbered them in seconds elapsed.

The replacement photos that I've created off of DVD's have names like 001.jpg, 002.jpg, et cetera. Changing 100 hyperlinks in every web file to match the new pictures would be tedious. So, what I'd like to do is copy the new files to the old directory, and overwrite the old ones. (Have 001.jpg overwrite 0998056812.jpg, 002.jpg overwrite 0998056828.jpg, and so on.)

I wouldn't mind doing it one file at a time, as long as it could be done with a quick click or two. Or I could do it in batches. The only hitch is that the new pictures have to match the old ones. So if I have one too many or one too few at a certain point, it would throw the whole sequence off. But I could do it in batches of 10 or so, then check to make sure that the sequence still matches. Provided that there's a way to do it.
User avatar
Stefan2
Power Member
Power Member
Posts: 4133
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

Do I see that right? 

You have the old files with good names:
0998056812
0998056828
E
H
U

And you have the new files:
001
002
005
008
010
which you could rename to
0998056812
0998056828
E
H
U


As long as the count match (1:1 relationship, new files same order as old files), you can
- take a list of the old names (cm_CopyNamesToClip and save to text file)
- rename the new files according to names from that list (MRT > Load names from file...)
- copy and overwrite the old files with the new ones. (F5)




If there is no direct 1:1 relationship between both lists, you may have to create a text or xls file with such a relationship on your own.




 
GraemeC
Junior Member
Junior Member
Posts: 25
Joined: 2009-08-27, 14:11 UTC

Overwriting Files With Different Names

Post by *GraemeC »

Right, that's what I'm trying to do. There's supposed to be a 1:1 correlation between the old files and new, but may not be if I make a mistake creating the new ones.

I tried it the hard way on a sample directory the other day, by creating a list of file names in a batch file. (I usually use a dir /b > !.txt command). Then I went in and manually turned every file name into a rename command (ren 001.jpg 0998056812.jpg, and so forth). It worked, but was very tedious.

What you're adding into the mix that I didn't know is the part about using (MRT > Load names from file...). I'll play with that. If I can rename the new files all at once with that command, it will make the job easy.
GraemeC
Junior Member
Junior Member
Posts: 25
Joined: 2009-08-27, 14:11 UTC

Overwriting Files With Different Names

Post by *GraemeC »

I'm trying it, but I must be doing something wrong. I've got a text file with a list of 10 file names I want to use. Then I have 10 files, named 001.jpg through 010.jpg. So...

Mark
Load Selection from File
Select the text file containing the new names.

And nothing happens. The Help File doesn't explain that command very well, either.
User avatar
Stefan2
Power Member
Power Member
Posts: 4133
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

Not "Load SELECTION from File"


Rather:
- mark files
- open MRT (menu Files > Multi-Rename Tool)
- Load names from file... (press F1 key in MRT to read the help and see the related icon)





 
Post Reply