Search for multiple text entries in files

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
Aebian
Junior Member
Junior Member
Posts: 12
Joined: 2016-06-20, 18:01 UTC

Search for multiple text entries in files

Post by *Aebian »

Hi TotalCMD,

I have a question, maybe its really simple:

Image: https://i.imgur.com/VmU2j4p.png

Where there is 'longid1" I want to add more longids that will be all searched. My goal is to get the location of every file called ATTRIB.ATR that contains any of these text inputed.
I tried it with "longid1 | longid2" but that doesn't seem to work. Any other ideas here?
The location thing works, but not the "Find text" part.

regards,

Alex
User avatar
Dalai
Power Member
Power Member
Posts: 10025
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Search for multiple text entries in files

Post by *Dalai »

The only way (without plugins) to do such a thing is the following: do a search for one of the texts, feed the result to listbox, mark all files and repeat the search process with the next term/text.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Aebian
Junior Member
Junior Member
Posts: 12
Joined: 2016-06-20, 18:01 UTC

Re: Search for multiple text entries in files

Post by *Aebian »

Okay and with plugins, what is a good plugin for TotalCMD for doing that?

Problem here is: the long id's are not in every file (ATTRIB.ATR) and not on every location and I would like to automate the process so I get a full listbox with all the found files.

e.g.: longlistid1 & longlistid2 & longlistid3 & longlistid4 & longlistid5 & longlistid6 and so one. Will be searched for and now the listbox displayes the results that it has found all the 6 files and so one.

[6 files and 0 directories found]
P:\sffs\SAP\bla\bla\14\ATTRIB.ATR (contains longlistid1)
I:\sffs\SAP\bla\bla\12\ATTRIB.ATR (contains longlistid2)
J:\sffs\SAP\bla\bla\24\ATTRIB.ATR (contains longlistid3)

and so one..

Thanks,

Regards,

Alex
User avatar
Dalai
Power Member
Power Member
Posts: 10025
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Search for multiple text entries in files

Post by *Dalai »

Aebian wrote: 2018-07-23, 15:52 UTCOkay and with plugins, what is a good plugin for TotalCMD for doing that?
Sorry, no idea. You might want to check the unofficial TC plugin site, especially the content plugins (which are used in TC search).

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
milo1012
Power Member
Power Member
Posts: 1158
Joined: 2012-02-02, 19:23 UTC

Re: Search for multiple text entries in files

Post by *milo1012 »

Aebian wrote: 2018-07-23, 15:36 UTC I tried it with "longid1 | longid2" but that doesn't seem to work. Any other ideas here?
Actually it does work. You need to enable RegEx (2), which means enable Regular Expression character matching.
The only thing to take care of are the RegEx reserved characters.
And don't add spaces before or after the pipe character.
See help section 3.n for RegEx details.
TC plugins: PCREsearch and RegXtract
Post Reply