TPIPE questions....

Apr 2, 2011
1,363
6
53
North Carolina, USA
Is TPIPE columns 1 or 0 based?

/dup=Type,MatchCase,StartColumn,Length,IncludeOne

For the length number - would it be the same as %_LINES_MAXLEN after a %@lines[filename] is done?

For the "IncludeOne - Include lines with a count of 1" - not sure what is meant here?

I did read the CHM but I am still a bit unsure....
 
May 20, 2008
11,046
90
Syracuse, NY, USA
When you use "Type" = 1 (Show duplicate lines), the last option determines whether you see lines with count of 1 (i.e., lines with no duplicates).
Code:
v:\> type abc.txt
a
a
b
c
c
c

v:\> tpipe /input=abc.txt /dup=1,0,0,1,0
2 a
3 c

v:\> tpipe /input=abc.txt /dup=1,0,0,1,1
2 a
1 b
3 c

All I can gather from below is that the column numbering starts with 1 but 0 is accepted as equivalent to 1. That's odd. Maybe Rex will explain it further.
Code:
v:\> type abc.txt
qaa
rba
sca

v:\> tpipe /input=abc.txt /dup=1,0,0,1,1
1 qaa
1 rba
1 sca

v:\> tpipe /input=abc.txt /dup=1,0,1,1,1
1 qaa
1 rba
1 sca

v:\> tpipe /input=abc.txt /dup=1,0,2,1,1
1 qaa
1 rba
1 sca

v:\> tpipe /input=abc.txt /dup=1,0,3,1,1
3 qaa

v:\>
 
Apr 2, 2011
1,363
6
53
North Carolina, USA
tpipe /input=tcmd.all /dup=0,1,0,999999,1 /output=tcmd_nodups.all

wouldn't this create a file with all lines - minus those with duplicates?

type aaa.aaa
a
a
a
b
d
c

>tpipe /input=aaa.aaa /dup=0,1,0,999999,1 /output=bbb.bbb

would result in
type bbb.bbb
a
b
d
c

bbb.bb is what I am looking for....... Just not sure of the /Dup= parameters....

<end of post>
 
May 20, 2008
11,046
90
Syracuse, NY, USA
That looks like simple removal of duplicates ///
Code:
v:\> type abc.txt
a
a
a
b
c
d

v:\> tpipe /input=abc.txt /output=abc1.txt /dup=0,0,1,1,1

v:\> type abc1.txt
a
b
c
d

v:\>
 
Apr 2, 2011
1,363
6
53
North Carolina, USA
So Am I correct in this?

v:\> type abc.txt
a
a
a
b
c
d

echo %@lines[abc.txt]
rem Above line will set %_LINES_MAXLEN as mentioned in the CHM

rem /dup=Type,MatchCase,StartColumn,Length,IncludeOne
tpipe /input=abc.txt /dup=0,1,0,%_LINES_MAXLEN,1 /output=abc_case_sensitive.txt
tpipe /input=abc.txt /dup=0,1,0,%_LINES_MAXLEN,0 /output=abc_case_insensitive.txt

Is the above lines correct - given the name of the output file???
 
May 20, 2008
11,046
90
Syracuse, NY, USA
That doesn't look right. /DUP's **2nd** parameter decides case sensitivity, not its last parameter. The only difference (other than the output file name) between your two examples is in the last parameter.
 
Thread starter Similar threads Forum Replies Date
Kachupp Support 4
H Support 4
D Support 1
Kachupp Support 8
C Support 5