compare directories using just the filename

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
rah
Junior Member
Junior Member
Posts: 12
Joined: 2006-07-23, 12:14 UTC
Location: New Hampshire, USA

compare directories using just the filename

Post by *rah »

Is there a way to compare the two displayed directories, but only using the FILENAME (ignore the extention). There is a compare directories item under the Mark menu which almost does what I want, but it uses the full names. I found a command to compare directories, but it doesn't seem to take any parameters.

My problem is that I have started using "raw + jpg" on my camera. When I copy my images to the computer, I usually put the jpgs in one directory and the raws in another. Then I go thru the jpgs using IrfanView and delete any I don't really want. I would like to have a mechanism to delete the matching raw images too. But I cannot find any easy way to do this.

I could, of course, keep both the jpgs and raws together in the same directory and when I go thru them with Irfan, delete both the jpg and raw then. But Irfan takes so looooong to open a raw that it really slows this down.

I was thinking there might be a way to get TC to somehow mark the 2 directories with the REMAINING images on the jpg side (using just the filename). Then I could go over to the raw side and invert the selection and delete the marked files. But I cannot figure out how to do it.

Any suggestions?
Thanks!
User avatar
petermad
Power Member
Power Member
Posts: 16140
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

I can think of one ways to do it - with the jpg's and the raw's in separate folders:

1. In the same panel mark the two folders holding the jpg's and raw's.
2. Press Alt+F7 - then the "Advanced" tab.
3. Click "Find duplicate files:", deselect "same name" and "same size".
4. Click on the [+] button an choose tc -> name.
5. Click "Start search" - and when performed click "Feed to listbox".
6. Mark all the files and use "Mark" -> "Copy Names With Path To Clipboard" (cm_CopyFullNamesToClip).
7. Go to the folder with raw files an use the internal command cm_LoadSelectionFromClip (make a button for it - or use my extended menu)
8. Reverse the selection by pressing Num *
9. Delete the remaining selected files.


With both jpg and raw files in same folder it is a little different:

1. In the image folder press Alt+F7 - then the "Advanced" tab.
2. Click "Find duplicate files:", deselect "same name" and "same size".
3. Click on the [+] button an choose tc -> name.
4. Click "Start search" - and when performed click "Feed to listbox".
5. Mark all the raw files by pressing Alt+Num + on a raw file.
6. Use "Mark" -> "Copy Names With Path To Clipboard" (cm_CopyFullNamesToClip).
7. Press Backspace to go back to the folder with all the jpg and raw files and press Ctrl+F12 - then write: *.raw and click "OK".
8. Use the internal command cm_LoadSelectionFromClip (make a button for it - or use my extended menu)
9. Reverse the selection by pressing Num *
10. Delete the remaining selected files.
11. Press Ctrl+F10 to display all files again.
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
rah
Junior Member
Junior Member
Posts: 12
Joined: 2006-07-23, 12:14 UTC
Location: New Hampshire, USA

Post by *rah »

That's very interesting, Petermad. I am going to study it some (I like to understand this stuff!) and then give it a try with both techniques (with some experimental folders).

I have actually never noticed the Advanced tab in the search box, even though I use it pretty frequently, so I'm finding this problem instructive already. I'll report back after I have tried things out.

Thanks!
rah
Junior Member
Junior Member
Posts: 12
Joined: 2006-07-23, 12:14 UTC
Location: New Hampshire, USA

success!

Post by *rah »

I tried the first idea and it works perfectly, and I understand it too. Very nice! I didn't try the 2nd idea because it really is much easier (as far as I have seen so far with raw+jpg) to have them separate.

That "feed to listbox" technique is very interesting. I have seen mentions of using lists in TC in this forum, but never really understood what folks were talking about. But now I see how you can change the list of files in a dir panel via that and other techniques (like using a file). Very cool.

By the way, I thought of a rather evil method to accomplish what I want ( to delete the un-matching raw files), and it is very simple. What you could do is rename all the raw files to a .jpg extension (using Multi-Rename tool), do a simple directory compare (which would detect the matches), then reverse the selection in the raw dir, delete them, and rename the rest back to the raw extension. Yikes! This is REALLY awful, IMHO, but it would work.

I am wondering if I should suggest an enhancement to the compare directory facility to allow options like just filename, etc. Seems right up TC's alley.

Just chatting, I already have a special button set to copy the filename(s) to the clipboard (use it all the time!) and a self-made icon for it. Plus I very recently discovered that the Start menu allows placing named commands within it (I've had TC for something like 20 years amnd never looked at the Start menu!). Up till now I've either been living with blank buttons (with hover tips) for special commands, or had to make an icon for the commands I wanted to use. NOW I find out I can set up commands in the Start menu. Better late than never!

I also noticed the item under Start for changing the menu itself via a file load, which I guess is what you meant about your extended menu. The more you delve into TC, the more stuff you find.

Thanks for the help!
User avatar
petermad
Power Member
Power Member
Posts: 16140
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

What you could do is rename all the raw files to a .jpg extension (using Multi-Rename tool), do a simple directory compare (which would detect the matches), then reverse the selection in the raw dir, delete them, and rename the rest back to the raw extension.
It will not work because the sizes of the jpg's and the raw's are different, so TC will just mark all files on both sides even though they have the same names.

Same thing with different stamps on files with same names - here all the newest files will be marked (unless the time difference is exactly 1 hour and you have set up TC to ignore 1-hour time delay).
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
petermad
Power Member
Power Member
Posts: 16140
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

I also noticed the item under Start for changing the menu itself via a file load, which I guess is what you meant about your extended menu.
No, not really - see http://ghisler.ch/board/viewtopic.php?t=33740 for extended menus.
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
rah
Junior Member
Junior Member
Posts: 12
Joined: 2006-07-23, 12:14 UTC
Location: New Hampshire, USA

Post by *rah »

OK, thanks for the additional feedback. Good to know that the diabolical extension renaming method wouldn't work anyway - I won't be tempted! I'll check out your extended menus...
Post Reply