TPIPE /grep?

May 20, 2008
11,400
99
Syracuse, NY, USA
How is it supposed to work? It has 8 parameters, right? None of these work.
Code:
g:\tc14> type fleas.txt
My
dog
has
fleas.
 
g:\tc14> do i=0 to 6 (tpipe /input=fleas.txt /grep=%i,0,0,0,0,0,0,M)
TPIPE: The parameter is incorrect.
"/grep=0,0,0,0,0,0,0,M"
TPIPE: The parameter is incorrect.
"/grep=1,0,0,0,0,0,0,M"
TPIPE: The parameter is incorrect.
"/grep=2,0,0,0,0,0,0,M"
TPIPE: The parameter is incorrect.
"/grep=3,0,0,0,0,0,0,M"
TPIPE: The parameter is incorrect.
"/grep=4,0,0,0,0,0,0,M"
TPIPE: The parameter is incorrect.
"/grep=5,0,0,0,0,0,0,M"
TPIPE: The parameter is incorrect.
"/grep=6,0,0,0,0,0,0,M"

And what are the differences among "restrict", "extract", and "remove"?
 

rconn

Administrator
Staff member
May 14, 2008
12,344
149
How is it supposed to work? It has 8 parameters, right?

No, it has 9 parameters:

Type​
IncludeLineNumbers​
IncludeFilename​
MatchCase​
CountMatches​
PatternType​
UTF8​
IgnoreEmpty​
Pattern​

(But I didn't think anybody would be crazy brave enough to try it while it was still flagged as untested!)

Tested and fixed some minor bugs for build 15.

And what are the differences among "restrict", "extract", and "remove"?

Extract and remove seem pretty self-explanatory. Restrict is only relevant for subfilters, which I haven't documented yet.
 
May 20, 2008
11,400
99
Syracuse, NY, USA
No, it has 9 parameters:

Type​
IncludeLineNumbers​
IncludeFilename​
MatchCase​
CountMatches​
PatternType​
UTF8​
IgnoreEmpty​
Pattern​

(But I didn't think anybody would be crazy brave enough to try it while it was still flagged as untested!)

Tested and fixed some minor bugs for build 15.



Extract and remove seem pretty self-explanatory. Restrict is only relevant for subfilters, which I haven't documented yet.
"Extract" and "remove" mean the same thing!

PatternType" missing here (from the help).
Code:
 /grep=Type,IncludeLineNumbers,IncludeFilename,IgnoreCase,CountMatches,UTF8,IgnoreEmpty,Pattern
 
May 20, 2008
11,400
99
Syracuse, NY, USA
Extract means copy those lines to the output file. Remove means don't copy those lines to the output file.
So, do "extract matching lines" and "remove non-matching lines" mean the same thing? What about "extract non-matching lines" vs. "remove matching lines"?
 
May 20, 2008
11,400
99
Syracuse, NY, USA
No. When you "extract", you keep the lines (and put them in a new file). When you remove, you delete them.

I still don't get it. When you "remove non-matching lines", what happens to the matching ones? In a very simple test, /grep with types 3 (extract matching lines) and 6 (remove non-matching lines) produce the same output (or an identical file).
 
May 20, 2008
11,400
99
Syracuse, NY, USA
Try it in a not-very-simple test, when you're sending output to multiple files, or overwriting the original file, or passing the results to subfilters.
Grep types 3 and 6 seem to work the same when overwriting the input file. I don't know how to specify multiple output files and I know even less about subfilters. This reminds me a little of trying to figure out how Oniguruma works from the header file.
 
Similar threads
Thread starter Title Forum Replies Date
L How to? tpipe grep stdout? Support 5
vefatica WAD Counting things with TPIPE /grep Support 11
samintz How to? TPIPE /simple=61 Support 6
R Bug TPIPE's pdf to text conversions don't work Support 2
Kachupp How to? tpipe Support 4
H TPIPE /simple=4 Support 12
D TPIPE produces unwanted logs. Support 1
Kachupp How to? tpipe Support 8
vefatica Documentation TPIPE, /perl, DotMatchesNewLines Support 1
vefatica Stop TPIPE /EOL removing bad EOLs (and TPIPE changine EOLs)? Support 2
vefatica TPIPE in an alias? Support 2
C How to? TPIPE ?'s Support 2
H History and TPipe Oddness Support 3
Jay Sage Baffling Behavior With TPIPE Support 5
vefatica TPIPE: unbalanced escaped quotes in a regex? Support 5
Joe Caverly Multiple Text Searches at once using FFIND or TPIPE Support 4
Kachupp FFIND TPIPE Support 9
vefatica TPIPE and avarice? Support 5
Peter Murschall TPIPE generate unicode on Piping or redirecting Support 3
x13 TPIPE /REPLACE - Remove line (including EOL) Support 3
Charles Dye Documentation TPIPE /REPLACELIST Support 0
Joe Caverly TPIPE and /inputstring Support 3
vefatica How to? Add real <ESC> characters with TPIPE Support 2
vefatica How to? TPIPE ... see output right away? Support 4
vefatica TPIPE.EXE crashes on Ctrl-C Support 9
O TPIPE: Error -Can´t access textpipeengine.dll Support 24
vefatica Extract fields with TPIPE? Support 10
vefatica TPIPE, crash and question Support 1
MickeyF Another TPIPE question Support 6
MickeyF Can't get my TPIPE /replace to work Support 4
Joe Caverly Printing TPIPE documentation Support 3
C WAD tpipe /simple=28 Support 8
vefatica Remove double-quotes with TPIPE Support 4
vefatica TPIPE crashes on Ctrl-C Support 1
C How to? Add date/time to custom tpipe based BTM Support 1
C tpipe /simple=28 error Support 5
C TPipe /dup Support 5
T TPipe: Replacing String with Double Quotes Support 3
C tpipe and extract email addresses Support 1
vefatica How do I do this with TPIPE? Support 1
vefatica TPIPE's /perl option? Support 1
D TPIPE help typo Support 0
vefatica TPIPE access violations are back Support 2
Joe Caverly Word Count using TPIPE Support 10
Dan Glynhampton TPIPE in Build 41 Support 4
Phileosophos TPIPE doesn't work at all with v16 Support 3
vefatica TPIPE access violation again Support 1
David McClelland TPIPE matching problem Support 3
vefatica TPIPE: Access violation Support 5
jbanaszczyk TCMD 16 - TPIPE Support 4

Similar threads