[Feature Request]Import file list with the output of CLI

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Troy_Daniel
Junior Member
Junior Member
Posts: 14
Joined: 2021-04-30, 14:14 UTC

[Feature Request]Import file list with the output of CLI

Post by *Troy_Daniel »

It would be nice to have the following features: read the output of a CLI command as filenames(relative to current path/fullpath), and show only those commands.

Currently filelist within a text file in the search panel (textbox "Search In"), one tricky way to achieve above purpose is to run the command, for example which I use a lot is `rg -l sometext` and redirect the output to a text file and '@the filename' in the "search in" box, "search" and "Fill files in panel". However, since the text "sometext" changes everytime, it's very time-consuming.

As far as I'm concerning, if the "search in" in "Search panel" and the "command" on the main panel supports "!command"(borrow from VIM), and consequently,
1. Run the "command" to get the filenames, and search only in the results, (Search panel).
2. Run the "command" to get the filenames, and show only the results, (main panel) as if expand all and execute "cm_LoadSelectionFromFile", "cm_ShowOnlySelected", "cm_ClearAll" in a row.

I think it would be cool, and very nice to exploit some CLI commands.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: [Feature Request]Import file list with the output of CLI

Post by *Horst.Epp »

In TC 10 you have the command LOADLIST which reads a list of files from a file
and displays it in the current side.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
Troy_Daniel
Junior Member
Junior Member
Posts: 14
Joined: 2021-04-30, 14:14 UTC

Re: [Feature Request]Import file list with the output of CLI

Post by *Troy_Daniel »

Horst.Epp wrote: 2021-04-30, 15:36 UTC In TC 10 you have the command LOADLIST which reads a list of files from a file
and displays it in the current side.
Yes, but still, some steps need: open command prompt, run the command and redirect to a temporary file, and at last delete the temporary file.

If I shall repeat this action in different folders/query text, it's quite boring and finger tiring.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: [Feature Request]Import file list with the output of CLI

Post by *Horst.Epp »

Troy_Daniel wrote: 2021-05-01, 06:53 UTC
Horst.Epp wrote: 2021-04-30, 15:36 UTC In TC 10 you have the command LOADLIST which reads a list of files from a file
and displays it in the current side.
Yes, but still, some steps need: open command prompt, run the command and redirect to a temporary file, and at last delete the temporary file.

If I shall repeat this action in different folders/query text, it's quite boring and finger tiring.
All of this steps can be made to run with the press of one button in TC.
Also why do you need deleting a temp file as in a normal procedure your script will always use the same name.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
Troy_Daniel
Junior Member
Junior Member
Posts: 14
Joined: 2021-04-30, 14:14 UTC

Re: [Feature Request]Import file list with the output of CLI

Post by *Troy_Daniel »

Horst.Epp wrote: 2021-05-01, 08:17 UTC
Troy_Daniel wrote: 2021-05-01, 06:53 UTC
Horst.Epp wrote: 2021-04-30, 15:36 UTC In TC 10 you have the command LOADLIST which reads a list of files from a file
and displays it in the current side.
Yes, but still, some steps need: open command prompt, run the command and redirect to a temporary file, and at last delete the temporary file.

If I shall repeat this action in different folders/query text, it's quite boring and finger tiring.
All of this steps can be made to run with the press of one button in TC.
Also why do you need deleting a temp file as in a normal procedure your script will always use the same name.
One button? I'm curious how to achieve that without the assisant of other scripts.
Noting that, the text to grep and the folder where to grep in change every once in a while.
A more realistic example is, for the folder structure,
--------------------
+ root folder
 + FolderA
  + files1
  + ...
 + FolderB
  + files2
  + ...
--------------------
1. grep text "hello" in FolderA, manipulate the resulting files;
2. grep text "example" in FolderB, and mainupate the resulting files.
I cannot come up with any ideas to finish the above tasks with one button except for typing the keywords(hello/example).
Any more detailed illustrations?
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: [Feature Request]Import file list with the output of CLI

Post by *Horst.Epp »

The folder to handle should be selected in TC and will be given as parameters to your script.
A button can have a ? in the parameter field which allows to enter your search text for example.
This is made with a button asking a text to search for and starting an em_command which executes your script.
You can chain commands in a button so the next command after executing your script is a LOADLIST
which let TC display the file which was created by your script.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
Troy_Daniel
Junior Member
Junior Member
Posts: 14
Joined: 2021-04-30, 14:14 UTC

Re: [Feature Request]Import file list with the output of CLI

Post by *Troy_Daniel »

Horst.Epp wrote: 2021-05-01, 12:02 UTC The folder to handle should be selected in TC and will be given as parameters to your script.
A button can have a ? in the parameter field which allows to enter your search text for example.
This is made with a button asking a text to search for and starting an em_command which executes your script.
You can chain commands in a button so the next command after executing your script is a LOADLIST
which let TC display the file which was created by your script.
Thank for your patience, and it is really helpful.
But if it is appreciated if the command-filter be added for convience.
MarekCzerski
Junior Member
Junior Member
Posts: 27
Joined: 2015-01-22, 01:18 UTC

Re: [Feature Request]Import file list with the output of CLI

Post by *MarekCzerski »

Hello! Your remarks and pieces of advice are really inspiring. However, what I would be most happy to learn is how to have files listed in a txt file displayed in a panel using a command line option, provided that this is at all possible. Your advice will be greatly appreciated. Regards Marek
Troy_Daniel
Junior Member
Junior Member
Posts: 14
Joined: 2021-04-30, 14:14 UTC

Re: [Feature Request]Import file list with the output of CLI

Post by *Troy_Daniel »

MarekCzerski wrote: 2021-08-19, 21:14 UTC Hello! Your remarks and pieces of advice are really inspiring. However, what I would be most happy to learn is how to have files listed in a txt file displayed in a panel using a command line option, provided that this is at all possible. Your advice will be greatly appreciated. Regards Marek
I searched the help manual, but am frustrated to find that, no.
There aren't any options to load a filelist in the command line switches. You can check it under [Configuration and Switches/Command line parameters].

But if you can just use loadlist <filename> after you open TC. Posssibly, totalcmd /o /l=<filename>, and then run
[em_load_selected]
cmd=loadlist
param=%P%N

Hope it helps.
MarekCzerski
Junior Member
Junior Member
Posts: 27
Joined: 2015-01-22, 01:18 UTC

Re: [Feature Request]Import file list with the output of CLI

Post by *MarekCzerski »

Thanks Troy, I will definitely use your advice and if it occurs successful, I will get back here again to share my experience.
Best regards, Marek
Post Reply