# TPIPE questions....

#### Charles G

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....

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:\>``````

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>

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:\>``````

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???

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.

How to? TPIPE questions
Replies
9
Views
770
Replies
5
Views
2K
Replies
12
Views
812
Replies
6
Views
548
Replies
2
Views
631
How to? tpipe
Replies
4
Views
949
Replies
12
Views
1K
Replies
1
Views
524
How to? tpipe
Replies
8
Views
900
Replies
1
Views
646
Replies
2
Views
758
Replies
2
Views
749
How to? TPIPE ?'s
Replies
2
Views
773
Replies
3
Views
963
Replies
5
Views
904
Replies
5
Views
1K
Replies
4
Views
1K
Replies
9
Views
2K
Replies
5
Views
994
Replies
3
Views
1K
Replies
3
Views
1K
Documentation TPIPE /REPLACELIST
Replies
0
Views
1K
Replies
3
Views
1K
Replies
2
Views
1K
Replies
4
Views
2K
Replies
9
Views
2K
Replies
24
Views
4K
Replies
10
Views
2K
Replies
1
Views
1K
Replies
6
Views
2K
Replies
4
Views
1K
Replies
3
Views
1K
Replies
8
Views
2K
Replies
4
Views
2K
Replies
1
Views
1K
Replies
1
Views
2K
Replies
5
Views
1K
Replies
5
Views
2K
Replies
3
Views
1K
Replies
1
Views
1K
Replies
1
Views
933
Replies
1
Views
1K
Replies
0
Views
1K
Replies
2
Views
1K
Replies
10
Views
3K
Replies
4
Views
1K
Replies
3
Views
1K
Replies
1
Views
1K
Replies
3
Views
1K
Replies
5
Views
2K