Selecting files with same name or name+ext
Moderators: Hacker, petermad, Stefan2, white
Selecting files with same name or name+ext
Suppose you have a list of files like
_DSC8038.xmp
_DSC8032.xmp
_DSC8030.xmp
_DSC8021.xmp
_DSC8019.xmp
I would like to be able to select files with the same names but different extensions, like
_DSC8038.raw
_DSC8032.raw
_DSC8030.raw
_DSC8021.raw
_DSC8019.raw
And also to be able to select files with exactly same names+extensions on another panel.
Is there any way to create such plugin or command?
_DSC8038.xmp
_DSC8032.xmp
_DSC8030.xmp
_DSC8021.xmp
_DSC8019.xmp
I would like to be able to select files with the same names but different extensions, like
_DSC8038.raw
_DSC8032.raw
_DSC8030.raw
_DSC8021.raw
_DSC8019.raw
And also to be able to select files with exactly same names+extensions on another panel.
Is there any way to create such plugin or command?
Re: Selecting files with same name or name+ext
mSnus wrote: 2021-04-12, 10:45 UTC I would like to be able to select files with the same names but different extensions, like
_DSC8038.raw ...
HISTORY.txt wrote:10.03.21 Release Total Commander 10.00 public beta 1
02.03.21 Added: New internal field tc->partner file with other extension finds e.g. all jpg files
where there is a raw file with the same name in the same directory (32/64)
- Search in separate process... Alt+Shift+F7
- Delete field content from field "Search in:"
- Click on the "Plugins" tab
- [✓] Search in plugins
Code: Select all
Plugin Property OP Value tc partner file with other extension = xmp
- Click on the "Load/Save" tab
- Click on button "Save"
- Template name, e.g. Partner_file_with_extension_XMP (no space in the name!), Button "OK", Button "Cancel"
- Change to the folder with .xmp and .raw files
- Menu "Show" - "Custom... Ctrl+F12" -> click on: Partner_file_with_extension_XMP (>Partner_file_with_extension_XMP is shown), OK
- Result: Files with extension .raw are shown (file filter for .raw files)
- Remove file filter for .raw files: Menu "Show" - "All Files Ctrl+F10"
What do you mean exactly?mSnus wrote: 2021-04-12, 10:45 UTC And also to be able to select files with exactly same names+extensions on another panel.
Re: Selecting files with same name or name+ext
The command to select files with exactly same names+extensions on another panel
Make this button
Make this button
Code: Select all
TOTALCMD#BAR#DATA
cm_SelectAllBoth,cm_CopyNamesToClip,cm_FocusTrg,cm_GoToFirstEntry,cm_ClearAll,cm_LoadSelectionFromClip,cm_CopyNamesToClip,cm_FocusTrg,cm_ClearAll,cm_LoadSelectionFromClip
wcmicons.dll,49
Mark files and folders that exist in both windows
0
-1
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
Re: Selecting files with same name or name+ext
2Horst.Epp
Yes, that's it!
Thank you!
Yes, that's it!

Thank you!
Re: Selecting files with same name or name+ext
If I remember I have stolen this from petermad

Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
Re: Selecting files with same name or name+ext
I also borrow a few buttons from him every now and then

Thankfully, he posts them in the forum.
2mSnus
This command, e.g. in a button: cm_MatchSrc could also be interesting in connection with this topic:
Code: Select all
cm_MatchSrc 532 Target=Source
Code: Select all
TOTALCMD#BAR#DATA
LOADSEARCH
?==Partner_file_with_extension_XMP
wcmicons.dll,47
LOADSEARCH ?==Partner_file_with_extension_XMP -> ENTER|finds e.g. all raw files where there is a xmp file with the same name in the same directory|Selecting files with same name or name+ext|https://www.ghisler.ch/board/viewtopic.php?f=14&t=74365
-1
Re: Selecting files with same name or name+ext
Where is this list? In a text file or selected in the current panel?
Overquoting is evil! 👎
Re: Selecting files with same name or name+ext
Strange, it doesn't seem to work in beta 5, 32bit, Windows 7. I can see flickering but no marked files/folder while they should be. Will test Win10 later if I don't forget (looking at the commands it should work)Horst.Epp wrote: 2021-04-12, 12:20 UTC The command to select files with exactly same names+extensions on another panel
Make this button
Edit: clipboard manager got in the way (TC commands to fast)
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
Re: Selecting files with same name or name+ext
Tags: "if exists" "existing" "also in other panel"
Regards, PhredE
Re: Selecting files with same name or name+ext
It's the 'list' of files in the directories illustrated by mSnus in the initial post, Flasher.
Regards, PhredE
Re: Selecting files with same name or name+ext
how to change this button to select files with the same names but different extensions?Horst.Epp wrote: 2021-04-12, 12:20 UTC The command to select files with exactly same names+extensions on another panel
Make this button
Code: Select all
TOTALCMD#BAR#DATA cm_SelectAllBoth,cm_CopyNamesToClip,cm_FocusTrg,cm_GoToFirstEntry,cm_ClearAll,cm_LoadSelectionFromClip,cm_CopyNamesToClip,cm_FocusTrg,cm_ClearAll,cm_LoadSelectionFromClip wcmicons.dll,49 Mark files and folders that exist in both windows 0 -1
Re: Selecting files with same name or name+ext
There are 2 buttons from Petermad.
Code: Select all
TOTALCMD#BAR#DATA
SELECTFILESS
"%S:~-0,255.*" "%S:~-0,255"
wcmicons.dll,39
Select all items with same base name as selected items|Hold Shift to also select folders
0
-1
Code: Select all
TOTALCMD#BAR#DATA
SELECTFILEST
"%S:~-0,255.*"
wcmicons.dll,39
Select all files with same base names in target panel
0
-1
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
Re: Selecting files with same name or name+ext
I use these em_commands in my Extended Menus:
For All the commands that mentions elements, you can hold down the Shift-key while executing to include folders
The em_ext_markBySelectedNames and em_ext_select_source should do what is asked for in the first post.
Code: Select all
[em_ext_markBySelectedNames]
cmd=SELECTFILESS
param=""%S:~-0,255.*""
menu=Mark elements with same names as selected elements
button=wcmicons.dll,39
[em_ext_markBySelectedTypes]
cmd=SELECTFILESS
param=""*.%S:~-0,-255""
menu=Mark elements with same types as selected elements
button=wcmicons.dll,41
[em_ext_select_duplicates]
cmd=cm_CompareDirsWithSubdirs 1,cm_ExchangeSelBoth,cm_FocusTrg,cm_ExchangeSelBoth,cm_FocusTrg
menu=Mark files and folders that exist in both windows
button=wcmicons.dll,72
[em_ext_select_non_duplicates]
cmd=cm_CompareDirsWithSubdirs 1
menu=Mark files and folders that does not exist in both windows
button=wcmicons.dll,72
[em_ext_select_source]
cmd=SELECTFILESTS
param=%Z%S
menu=Select elements in target side, if selected in source side
;
[em_ext_deselect_source]
cmd=SELECTFILESTUS
param=%Z%S
menu=Deselect elements in target side, if selected in source side
;
[em_ext_deselect_source2]
cmd=SELECTFILESUS
param=%Z%S
[em_ext_deselect2_source]
cmd=em_ext_deselect_source,em_ext_deselect_source2
menu=Deselect elements in both sides, if selected in source side
;
[em_ext_select_target]
cmd=SELECTFILESS
param=%Z%R
menu=Select elements in source side, if selected in target side
;
[em_ext_deselect_target]
cmd=SELECTFILESUS
param=%Z%R
menu=Deselect elements in source side, if selected in target side
;
[em_ext_deselect_target2]
cmd=SELECTFILESTUS
param=%Z%R
[em_ext_deselect2_target]
cmd=em_ext_deselect_target,em_ext_deselect_target2
menu=Deselect elements in both sides, if selected in target side
;
[em_ext_select_type_source]
cmd=SELECTFILESS
param=%Z"*.%E"
[em_ext_select_type_target]
cmd=SELECTFILESTS
param=%Z"*.%E"
[em_ext_select_type]
cmd=em_ext_select_type_source,em_ext_select_type_target
menu=Select all elements with the same extension in both sides
;
[em_ext_deselect_type_source]
cmd=SELECTFILESUS
param=%Z"*.%E"
[em_ext_deselect_type_target]
cmd=SELECTFILESTUS
param=%Z"*.%E"
[em_ext_deselect_type]
cmd=em_ext_deselect_type_source,em_ext_deselect_type_target
menu=Deselect all elements with the same ekstension in both sides
;
[em_ext_select_name_source]
cmd=SELECTFILESS
param=%Z"%O.*"
[em_ext_select_name_target]
cmd=SELECTFILESTS
param=%Z"%O.*"
[em_ext_select_name]
cmd=em_ext_select_name_source,em_ext_select_name_target
menu=Select all elements with the same name in both sides
;
[em_ext_deselect_name_source]
cmd=SELECTFILESUS
param=%Z"%O.*"
[em_ext_deselect_name_target]
cmd=SELECTFILESTUS
param=%Z"%O.*"
[em_ext_deselect_name]
cmd=em_ext_deselect_name_source,em_ext_deselect_name_target
menu=Deselect all elements with the same name in both sides
;
[em_ext_select_nameext_source]
cmd=SELECTFILESS
param=%Z"%N"
[em_ext_select_nameext_target]
cmd=SELECTFILESTS
param=%Z"%N"
[em_ext_select_nameext]
cmd=em_ext_select_nameext_source,em_ext_select_nameext_target
menu=Select all elements with the same name + extension in both sides
;
[em_ext_deselect_nameext_source]
cmd=SELECTFILESUS
param=%Z"%N"
[em_ext_deselect_nameext_target]
cmd=SELECTFILESTUS
param=%Z"%N"
[em_ext_deselect_nameext]
cmd=em_ext_deselect_nameext_source,em_ext_deselect_nameext_target
menu=Deselect all elements with the same name + extension in both sides
The em_ext_markBySelectedNames and em_ext_select_source should do what is asked for in the first post.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Selecting files with same name or name+ext
This is not suitable for names with multiple dots. It should be done by analogy with the following example for the current item:
Code: Select all
TOTALCMD#BAR#DATA
SELECTFILESS
<^%O\.?[^.]*$
wcmicons.dll,39
Select all items/files (w/wo Shift) with same base name under the cursor
Last edited by Fla$her on 2025-03-20, 23:10 UTC, edited 1 time in total.
Overquoting is evil! 👎
Re: Selecting files with same name or name+ext
This is not suitable for names with multiple dots
Code: Select all
cmd=SELECTFILESS
param=""%S:~-0,255.*""
--------------------Help wrote: The Start value -0 is special: %N:~-0,20 copies the first 20 characters of the name without extension, %N:~-0,-20 the first 20 characters of the extension without the name.
The parameters %S, %R, %P%S and %T%R in double quotes now support prefix and suffix text: "beforename%Sbeforeext%Eafterext" inserts string 'beforename' before the name, 'beforeext' before the last dot and extension, and 'afterext' after the extension.
Code: Select all
<%O\.?[^.]*$
if I have for example these files:
DE.FA.ULT.BAR
De.fa.ult.zi
De.fa.ult.zip
x.x.yy.txa
x.x.yy.txt
xx.txt
and I mark:
De.fa.ult.zi
x.x.yy.txa
and place the cursor on xx.txt
Then only xx.txt is marked additionally
With my solution these files are marked:
DE.FA.ULT.BAR
De.fa.ult.zi
De.fa.ult.zip
x.x.yy.txa
x.x.yy.txt
as expected.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar