cm_LoadSelectionFromFile: need to ingore characters, how?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
Petas
Junior Member
Junior Member
Posts: 6
Joined: 2014-12-11, 05:00 UTC

cm_LoadSelectionFromFile: need to ingore characters, how?

Post by *Petas »

Hello everybody, could anybody help me please?
I´m using "cm_LoadSelectionFromFile" but I need to ingore "-" and "space" characters.
In the file.txt is for examle 21 apr350-01-00.* but the filename is 21a-pr3 5001-00.*.
Differences are individual for almost every filename.
Thank you very much indeed.
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1052
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR »

Do you need to keep the exact file names? If not I would simply remove the "-" and space chars from the file names with the Multi-Rename Tool and from the selection file.

If you have to keep them you could create an "undo-renaming" batch file first.
It depends a little on how often you have to make a selection and what you're actually trying to accomplish.
Petas
Junior Member
Junior Member
Posts: 6
Joined: 2014-12-11, 05:00 UTC

Post by *Petas »

Thank you for your proposal.
But I´m afraid I have no write permision. I´m choosing from the huge database and copy it to my folder. The filenames have to be kept cause they´re linked to each other.
Last edited by Petas on 2014-12-12, 07:27 UTC, edited 1 time in total.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I would suggest you to replace "-" and " " with "?" or "*" to extend selection mask. But I see completely weird filename in your example with a hyphen in the middle of month name... such one may require to add "*" just after every character. This crazy thing may be done using regex replace "." with ".\*" in most normal text editors. Also removing all "-" from file may be useful here.
Petas
Junior Member
Junior Member
Posts: 6
Joined: 2014-12-11, 05:00 UTC

Post by *Petas »

Many thanks but searching for more simple solution.
Some modification (rewriting) this command or some script wouldn´t be avaylaible somewhere?
Thank you all for your help.
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

Petas wrote:Many thanks but searching for more simple solution.
Some modification (rewriting) this command or some script wouldn´t be avaylaible somewhere?
No.

You can have a bunch of file names in the list view
and a list of file names in a text file (or the clipboard)

You have to take care yourself that both can much,
for example by modifying the text file with some search&replace tool.

If you get always the very same problem, you may develop
a script to modify the text file every time the same way.
Therefore you have to provide a common usable rule.
But I doubt you can, as you stated "Differences are individual for almost every filename."
So you have to do some handwork here.


 
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1052
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR »

Do you have to keep the filenames yourself or can you just not touch them on the server?

A workaround could be VirtualPanel. Copy the files there, rename, select and then copy them to your disk. The first copy and the renaming is virtual as the plugin name suggests.
Petas
Junior Member
Junior Member
Posts: 6
Joined: 2014-12-11, 05:00 UTC

Post by *Petas »

Hello ZoSTeR,
and thank you very much indeed forf your time.
I´m afraid I´m not so familiar with using Tcmd to install this plugin sucessfully nor haven´t time to learn how.
Would you be so kind and give me some basic instruction?
I have unpacked the file into c:\Program Files (x86)\totalcmd\plugins\wdx\
and add the plugin in configuration/plugin/configure (wfx) - pointed to file VirtualPanel.wfx
When I run VPBatch.exe nothing happens.
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1052
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR »

VirtualPanel is a filesystem plugin. It can be reached via the "Network Neighborhood" drive button or issuing a "cd \\\VirtualPanel\" in the command line.

You can install plugins by simply opening the Zip file from within TC. It will come up with an installation dialog.

Under the hood VirtualPanel uses a simple textbased filelist to display its content. It looks something like this:

\VirtualFilename1.txt       \\Server\RealFile.txt
\VirtualFile2.exe              c:\Dir\RealFile.exe

So besides the Multi-Rename Tool in TC you could even use a texteditor to manipulate the virtual names directly.

Do a Rightclick -> Properties on the VirtualPanel icon for settings and filelist path.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Virtual Panel only exists within TC, so it may be found only in TC's hood. But you can keep any files within it, and links to files may be renamed so search/select/copy operations will use new names.
Petas
Junior Member
Junior Member
Posts: 6
Joined: 2014-12-11, 05:00 UTC

Post by *Petas »

Hello and thanks a lot to both of you.
VP works perfectly. But need to keep original filenames after downloading them into my directory. Hope multirename tool can work reversely.
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1052
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR »

The quickest way I found is the following:

After you have your final file selection in the VirtualPanel, instead of copying it with TC, enter "<explore" into the command line.
From that new window copy the files to their final destination. The copied files will have their original name.

You can display the original/physical name within VP with the custom columns [=tc.path][=tc.fullname] but unfortunately you can't use them inside MRT.

I'm sure MVV has a more elegant solution since he invented the somewhat complex internal VP commands ;)
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

You're right, copying from virtual explorer keeps original filenames, but it is more a missing feature (it was difficult to implement) than expected behaviour. But for now it will be useful. Selected files just need to be copied to new folder and then that folder should be opened in virtual explorer in order to select all files and export them.

Unfortunately it seems that TC doesn't support plugin fields in MRT within virtual panel so reversed renaming won't be just that easy...
Petas
Junior Member
Junior Member
Posts: 6
Joined: 2014-12-11, 05:00 UTC

Post by *Petas »

Hello guys just want to thank you with all my hart.
You were very kind to me and also helpful.
It´s what I was searching for.
A little bit slower cause in the database is over 200 000 files but it doesn´t matter.
Take care and THANK YOU!!! :-)
Post Reply