Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

TPIPE?

TPIPE can already do that.
How do I do this with TPIPE ... extract the 5th space-delimited field from each line?
Code:
v:\> tail w32tm.log
2012-05-13 Sun 03:17:01 Correction: +0.015 s  RTT:  61 ms
2012-05-14 Mon 03:17:01 Correction: +0.038 s  RTT:  63 ms
2012-05-15 Tue 03:17:01 Correction: +0.002 s  RTT:  61 ms
2012-05-16 Wed 03:17:01 Correction: -0.003 s  RTT:  60 ms
2012-05-17 Thu 00:08:03 Correction: -0.695 s  RTT:  55 ms
2012-05-17 Thu 03:17:00 Correction: +0.010 s  RTT:  70 ms
2012-05-18 Fri 03:17:01 Correction: +0.037 s  RTT:  61 ms
2012-05-19 Sat 03:17:01 Correction: -0.113 s  RTT:  55 ms
2012-05-20 Sun 03:17:01 Correction: +0.048 s  RTT:  89 ms
2012-05-21 Mon 03:17:01 Correction: +0.006 s  RTT:  63 ms
 
v:\> tail w32tm.log | cut -d" " -f5
+0.015
+0.038
+0.002
-0.003
-0.695
+0.010
+0.037
-0.113
+0.048
+0.006
 
How do I do this with TPIPE ... extract the 5th space-delimited field from each line?
Code:
v:\> tail w32tm.log
2012-05-13 Sun 03:17:01 Correction: +0.015 s  RTT:  61 ms
v:\> tail w32tm.log | cut -d" " -f5
+0.015
+1 and the other question stands for me, how can you cut by column position using TPIPE?
 
How do I do this with TPIPE ... extract the 5th space-delimited field from each line?

Code:
tail w32tm.log | cut -d" " -f5 | tpipe /grep=2,0,0,0,0,0,0,0,.*
+0.015
+0.038
+0.002
-0.003
-0.695
+0.010
+0.037
-0.113
+0.048
+0.006


HAHAHAHAHA!!! I crack myself up!

Sorry... couldn't resist.

But seriously, I don't see it in the documentation other than some convoluted /grep regex.
 
You could also use AWK
Code:
tail w32tm.log | gawk "{print $5}"
+0.015
+0.038
+0.002
-0.003
-0.695
+0.010
+0.037
-0.113
+0.048
+0.006
 
Use the /selection filter.
I'd like to try it but it's not described in the help.
The quick (command line) help for TPIPE has no newlines in it (on purpose?). It's very hard to read.
What's the status of /sort? Did you hear from the developers about that screwy file?
 
Build 18 didn't get the updated help file due to a crash in the help compiler. It's been fixed for build 19.

The quick help has no newlines in it because if it did, it would be even harder to read because it wouldn't fit on one (or two) screen pages. Remember, I *did* warn everyone clamoring for the TPIPE quick help that it wouldn't be of the slightest benefit ...

/sort has been removed and will not be in the initial v14 release.
 
Use the /selection filter.
I tried for about 40 minutes and could only get "the parameter is incorrect". How do get from here:

Code:
c:\users\vefatica\appdata\roaming\jp software> ffind /m /s tcmd.msi
C:\Users\vefatica\AppData\Roaming\JP Software\Take Command 13.04 13.04.53\install\B321F08\tcmd.msi
C:\Users\vefatica\AppData\Roaming\JP Software\Take Command 13.04 13.04.54\install\6CDFEDC\tcmd.msi
(snip)

to here

Code:
c:\users\vefatica\appdata\roaming\jp software> ffind /m /s tcmd.msi | g:\gnu\cut -f9 -d \
B321F08
6CDFEDC
(snip)

with TPIPE? I want to see the 9th \-delimited field.

And maybe someone will tell me what all this means.
Code:
/selection=Type,Locate,Param1,Param2,MoveTo,nDelimiter,CustomDelimiter,HasHeader
Type - The type of filter to add:
0 - Delete column
6 - Remove lines
7 - Remove delimited fields (CSV, Tab, Pipe, etc.)
9 - Move columns
10 - Move delimited fields (CSV, Tab, Pipe, etc.)
12 - Copy columns
13 - Copy delimited fields (CSV, Tab, Pipe, etc.)
17 - Remove byte range
 
Locate method - How to determine which areas to affect
0 - Restrict %d .. %d
1 - Restrict %1:d starting at %0:d
2 - Restrict %1:d starting at END - %0:d
3 - Restrict %d .. END - %d
4 - Restrict END - %d .. END - %d
 
Param1, Param2 - The integer values for the locate method
 
MoveTo - the integer value where to move or copy the columns or fields to (first columns or field is 1).
 
Here's a simpler one. How do I do this with TPIPE?

Code:
v:\> echo My\dog\has\fleas. | g:\gnu\cut -d \ -f2
dog
 
Use the /selection filter.
What is the correct syntax for the /selection filter?
The help file dated Tuesday, May 29, 2012 says
Code:
/selection=Type,Locate,Param1,Param2,MoveTo,nDelimiter,CustomDelimiter,HasHeader
whereas the command line says
Code:
/selection=Type,Locate,Param1,Param2,MoveTo,ProcessIndividually,Delimiter,CustomDelimiter,HasHeader
 
What is the correct syntax for the /selection filter?
The help file dated Tuesday, May 29, 2012 says
Code:
/selection=Type,Locate,Param1,Param2,MoveTo,nDelimiter,CustomDelimiter,HasHeader
whereas the command line says
Code:
/selection=Type,Locate,Param1,Param2,MoveTo,ProcessIndividually,Delimiter,CustomDelimiter,HasHeader
Aha! So it might take 9 parameters? I tries a few times using 9 parameters and got nothing but "the parameter is incorrect". Snooping around TPIPE.EXE, it seems it's coded for 8 parameters:

Code:
s.e.l.e.c.t.i.o.n.=.....%.d.,.%.d.,.%.d.,.%.d.,.%.d.,.%.d.,.%.s.,.%.d.

In any event, I don't think it's working.
 
Other discrepancies where either parameter count (string, file, grep) or parameter order (grep) don't match.

Help file
Code:
/string=type,MatchCase,string
/file=type,MatchCase,filename
/grep=Type,IncludeLineNumbers,IncludeFilename,MatchCase,CountMatches,PatternType,UTF8,IgnoreEmpty,Pattern
Command line
Code:
/string=type,string
/file=type,filename
/grep=Type,IncludeLineNumbers,IncludeFilename,IgnoreCase,CountMatches,UTF8,PatternType,Pattern
 
I tried for about 40 minutes and could only get "the parameter is incorrect". How do get from here:

Code:
c:\users\vefatica\appdata\roaming\jp software> ffind /m /s tcmd.msi
C:\Users\vefatica\AppData\Roaming\JP Software\Take Command 13.04 13.04.53\install\B321F08\tcmd.msi
C:\Users\vefatica\AppData\Roaming\JP Software\Take Command 13.04 13.04.54\install\6CDFEDC\tcmd.msi
(snip)

to here

Code:
c:\users\vefatica\appdata\roaming\jp software> ffind /m /s tcmd.msi | g:\gnu\cut -f9 -d \
B321F08
6CDFEDC
(snip)

with TPIPE? I want to see the 9th \-delimited field.

I don't understand why you would want to use TPIPE (a text file processor) with TCMD.MSI (a binary file -- which doesn't have anything you could describe as a "9th field").
 
I don't understand why you would want to use TPIPE (a text file processor) with TCMD.MSI (a binary file -- which doesn't have anything you could describe as a "9th field").

Huh? Read what I was doing carefully. "ffind /m /s tcmd.msi" produces lines like this:

Code:
C:\Users\vefatica\AppData\Roaming\JP Software\Take Command 13.04 13.04.53\install\B321F08\tcmd.msi

I wanted to use TPIPE to pick out the 9th \-delimited field in such a line, as CUT.EXE can do.

Code:
c:\users\vefatica\appdata\roaming\jp software> ffind /m /s tcmd.msi | g:\gnu\cut -f9 -d \
B321F08

I only wanted to process the output of FFIND.
 
There is something *very* strange about that file. TPIPE is actually sorting it, albeit very slowly (it took about 20 minutes on my system). I created a similar file that was about 3.5 Mb with 300,000 lines that sorts in 2.1 seconds, so I know it's not an issue with the file size or number of lines.

I'll send the file to the textpipeengine.dll developers to test.
Not a gripe, but did you ever do that, and did they respond? The difference between TPIPE's SORT and SORT.EXE is huge, even on small files.
 

Similar threads

Back
Top