select file -- having same filename with different extension

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
warem
Junior Member
Junior Member
Posts: 21
Joined: 2010-03-05, 12:14 UTC

select file -- having same filename with different extension

Post by *warem »

In left panel, I select all doc files for example. In right panel, how can I select all the pdf version of those files in the left panel.

Code: Select all

selections in Left Panel      the desired selections in Right Panel
1.doc                               1.pdf
2.doc                               2.pdf
Please note that there are a lot of files in many kinds: doc, xls, dwg, etc..

Any plugin or method for this purpose?

Thank you.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

You can copy selected names to clipboard and then replace .doc with .pdf in your text editor and then load selection from clipboard in a target panel...
warem
Junior Member
Junior Member
Posts: 21
Joined: 2010-03-05, 12:14 UTC

Post by *warem »

@MVV, is it possible to do the replacement in clipboard? Or do you mean I do the replacement in a text editor, e.g., I prefer to Vim, then ctrl - v to clipboard? Anyway, your method works for my purpose. Thank you.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Great that it works!

If you're familiar with some scripting systems, you can create a script that will replace text in clipboard.
warem
Junior Member
Junior Member
Posts: 21
Joined: 2010-03-05, 12:14 UTC

Post by *warem »

@MVV, I am not familiar with script language. If you know it, could you please make it? It is really appreciating.
warem
Junior Member
Junior Member
Posts: 21
Joined: 2010-03-05, 12:14 UTC

Post by *warem »

According to MVV's reply, since I don't know how to edit clipboard, I use a file.

-> Use `cm_SelectCurrentExtension` to select all doc files for example.
-> Use `cm_CopyNamesToClip` to copy all selections to clipboard.
-> open a blank txt file named `sel.txt` for example, ctrl - v then save the file.
-> I use `Vim` to edit the file. In Vi, use `:%s/doc$/pdf/g` then `:wq`. Use whatever editor you prefer to do the edition.
-> Use `cm_LoadSelectionFromFile` in target panel from the file above, you get all the selections.
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Selecting same name but different extension Multi Rename Too

Post by *Stefan2 »

warem wrote:In left panel, I select all doc files for example. In right panel, how can I select all the pdf version of those files in the left panel.

Code: Select all

selections in Left Panel      the desired selections in Right Panel
1.doc                               1.pdf
2.doc                               2.pdf
Please note that there are a lot of files in many kinds: doc, xls, dwg, etc..

Any plugin or method for this purpose?

Thank you.
You can also abuse MRT

- select *.doc files

- open MRT Ctrl+M
- change extension [E] to new extensions "pdf"

- utilize "Edit names..."
- select all Ctrl+A
- copy to clipboard Ctr+C
- close editor ( click [OK] or [Cancel], no matter )
- close MRT ( do NOT rename anything, this was only to modify the name string)

- utilize `cm_LoadSelectionFromClip' board
(i recomment here "Extended English Menus" by petermad)
warem
Junior Member
Junior Member
Posts: 21
Joined: 2010-03-05, 12:14 UTC

Post by *warem »

@Stefan2, cool! Another way. Also learn how to use MRT in abnormal but efficient way!
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

warem,
Don't know if vim supports command line parameters for replacing. Using EmEditor I would create following button:

Code: Select all

Command: EmEditor.exe
Parameters: /sp %WF /ri ".doc" /rw ".pdf"
By clicking the button TC will create temporary list with names of selected files and pass its path instead of %WF parameter. EmEditor then will open file and replace .doc with .pdf. I think it won't be hard to create a macro that will copy all text to clipboard and then close editor...

Anyway, if you have command-line replace tool, you can use batch file for replacing text in a temporary list (just pass %F to it as a parameter). Then you can use tools like NirCmd to copy file's contents to clipboard.
Post Reply