Multiple Text Searches at once using FFIND or TPIPE

Code:
     _x64: 1
   _admin: 1
_elevated: 1

TCC  25.00.11 x64   Windows 10 [Version 10.0.18362.239]
OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.18362 N/A Build 18362

The Microsoft FindStr command allows me to do multiple searches for text at once;
Code:
e:\utils>systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.18362 N/A Build 18362

Is this possible using either FFind or TPipe? I have tried the following;
Code:
e:\utils>systeminfo | ffind /kvm /t"OS Name" /t"OS Version"
OS Version:                10.0.18362 N/A Build 18362
BIOS Version:              Dell Inc. A18, 2018-11-14

e:\utils>systeminfo | tpipe /grep=3,0,0,0,0,0,0,0,"OS Name" /grep=3,0,0,0,0,0,0,0,"OS Version"

...but did not get the desired results.

Joe
 
Apr 18, 2014
301
9
I think FFIND will only take one /t parameter (from your example it looks to use the last one on the line) and TPIPE filters are sequential, so the output of the first grep filter in your example is used as the input to the second one, hence the reason nothing matches.

The only way I can think of doing it in TCC is with a regular expression. I had to look at the help to see if FFIND supports them, and it doesn't seem to, but TPIPE does. So your example search could be done like this for example:

Code:
d:\>systeminfo | tpipe /grep=3,0,0,0,0,0,0,0,"\bOS [NV]"
OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.18362 N/A Build 18362
 
  • Like
Reactions: Joe Caverly
Apr 18, 2014
301
9
FFIND and TPIPE do not support multiple simultaneous searches.

FFIND does support regular expressions (with the /E"..." option).
I don't know how I missed that /E option when I looked at the help...

So Joe could do this with FFIND (assuming the TCC default escape character):
Code:
d:\>systeminfo | ffind /k /m /v /e"^^OS [NV]"
OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.18362 N/A Build 18362
 
May 20, 2008
11,520
102
Syracuse, NY, USA
You should be able to "OR" several regular expressions with either FFIND /E or TPIPE's grep ...

Code:
v:\> systeminfo | FFIND /k /m /v /E"OS Name|OS Version"
OS Name:                   Microsoft Windows 10 Pro for Workstations
OS Version:                10.0.18362 N/A Build 18362
BIOS Version:              Dell Inc. 1.1.6, 2018-12-14

Get rid of the unwanted one with a BOL indicator.

Code:
v:\> systeminfo | FFIND /k /m /v /E"^OS Name|^OS Version"
OS Name:                   Microsoft Windows 10 Pro for Workstations
OS Version:                10.0.18362 N/A Build 18362
 
  • Like
Reactions: Joe Caverly
Similar threads
Thread starter Title Forum Replies Date
MickeyF TCC crashing when copying multiple files (now resolved) Support 6
N Unable to bind multiple keys to the same key mapping directive Support 9
vefatica Console not redrawn in BTM or with multiple commands Support 4
C duplicate files in multiple plugin sites Support 9
kb6ojs ALIAS with multiple commands? Support 9
vefatica How do I do this with a multiple-line DO? Support 7
R How to? Append files in multiple subfolders using copy? Support 8
N multiple command alias and redirection Support 0
B Can copy command concatenate multiple mp3 files Support 2
C INSTALLED returnes same program multiple times Support 14
M Delete multiple Alternate Datastreams Support 5
D What are the rules for detecting multiple versions of TC on a machine? Support 7
C FOLDERMONITOR inactive with multiple /I Support 1
C WAD VIEW print multiple files - switches fail Support 10
vefatica Multiple instances of help file Support 3
J How to? Array sort according to multiple keys Support 3
Alexander WAD The number of files and dirs are multiplied when using multiple wildcards Support 6
Jay Sage Version 17 Installer Leaves Multiple Copies of ShrAlias Support 48
R Fixed Internal ZIP command fails to process multiple files Support 3
M How to? PDir on multiple wildcard patterns... Support 2
A WAD Dir daterange + multiple path wildcards crashes tcc Support 2
T How to? Using FOLDERMONITOR 1 event causes multiple trigger(ing)s Support 8
samintz How to? Pull out multiple matching lines Support 5
D WAD Multiple TEE causese weird variable scoping? Support 7
L "for" in multiple lines Support 2
S TAR with multiple files and /G Support 2
Frank VIEWing multiple files possible? Support 4
J syntax problems multiple commands (command & command) Support 4
J How do I - ffind - with multiple items Support 10
R multiple monitor 'help' Support 7
H Another multiple FTP password prompt issue Support 2
J tcmd height with multiple monitors Support 2
T Open & Configure multiple TCC windows on STARTUP Support 4
vefatica Tab (^t) in @FILEWRITE's text Support 2
R Bug TPIPE's pdf to text conversions don't work Support 2
Joe Caverly Using TYPE with non-English text Support 22
M Goto fails when a text endtext block precedes the code Support 5
Joe Caverly No blank line in TEXT...ENDTEXT in a LIBRARY function Support 8
S INPUT fails if the entered text contains pair of square brackets Support 6
Alpengreis List command: text truncated in find box (german) Support 9
vefatica Text invisible in v25 Support 10
S How to? What's the maximum size of the thread text ? Support 5
E Text copy bug Support 1
S FFIND text that includes " Support 7
S Setting Tabs=Bottom makes text turn black Support 6
AndrewJ TakeCommand v23 + ANSI color sequences leads to black on black text Support 6
D Grabbing html text with @line Support 3
M TCC screen text bright colors not as bright in 24 as 23 Support 5
vefatica Find Files/Text dialog: does it work? Support 0
Alpengreis Installer: text is still truncated in german language Support 2

Similar threads