1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

TPIPE?

Discussion in 'Support' started by vefatica, May 16, 2012.

  1. vefatica

    vefatica

    Joined:
    May 20, 2008
    Messages:
    5,321
    Likes Received:
    7
    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
     
    #31
  2. Stefano Piccardi

    Stefano Piccardi

    Joined:
    May 31, 2008
    Messages:
    365
    Likes Received:
    2
    +1 and the other question stands for me, how can you cut by column position using TPIPE?
     
    #32
  3. JohnQSmith

    JohnQSmith

    Joined:
    Jan 19, 2011
    Messages:
    447
    Likes Received:
    3
    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.
     
    #33
  4. JohnQSmith

    JohnQSmith

    Joined:
    Jan 19, 2011
    Messages:
    447
    Likes Received:
    3
    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
     
    #34
  5. rconn

    rconn Administrator Staff Member

    Joined:
    May 14, 2008
    Messages:
    6,995
    Likes Received:
    19
    Use the /selection filter.
     
    #35
  6. rconn

    rconn Administrator Staff Member

    Joined:
    May 14, 2008
    Messages:
    6,995
    Likes Received:
    19
    Use the /selection filter.
     
    #36
  7. vefatica

    vefatica

    Joined:
    May 20, 2008
    Messages:
    5,321
    Likes Received:
    7
    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?
     
    #37
  8. rconn

    rconn Administrator Staff Member

    Joined:
    May 14, 2008
    Messages:
    6,995
    Likes Received:
    19
    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.
     
    #38
  9. vefatica

    vefatica

    Joined:
    May 20, 2008
    Messages:
    5,321
    Likes Received:
    7
    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).
    
     
    #39
  10. vefatica

    vefatica

    Joined:
    May 20, 2008
    Messages:
    5,321
    Likes Received:
    7
    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
     
    #40
  11. JohnQSmith

    JohnQSmith

    Joined:
    Jan 19, 2011
    Messages:
    447
    Likes Received:
    3
    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
     
    #41
  12. vefatica

    vefatica

    Joined:
    May 20, 2008
    Messages:
    5,321
    Likes Received:
    7
    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.
     
    #42
  13. JohnQSmith

    JohnQSmith

    Joined:
    Jan 19, 2011
    Messages:
    447
    Likes Received:
    3
    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
    
     
    #43
  14. rconn

    rconn Administrator Staff Member

    Joined:
    May 14, 2008
    Messages:
    6,995
    Likes Received:
    19
    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").
     
    #44
  15. vefatica

    vefatica

    Joined:
    May 20, 2008
    Messages:
    5,321
    Likes Received:
    7
    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.
     
    #45
  16. Rod Savard

    Rod Savard

    Joined:
    May 26, 2008
    Messages:
    306
    Likes Received:
    1
    The "aemail" folder is still being created in the release build of 14.

    Thanks,
    Rod
     
    #46
  17. vefatica

    vefatica

    Joined:
    May 20, 2008
    Messages:
    5,321
    Likes Received:
    7
    Yes. I didn't think so at first, after using TPIPE in a pipe a few times. But a simple "TPIPE /?" brought it back.
     
    #47
  18. vefatica

    vefatica

    Joined:
    May 20, 2008
    Messages:
    5,321
    Likes Received:
    7
    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.
     
    #48
  19. rconn

    rconn Administrator Staff Member

    Joined:
    May 14, 2008
    Messages:
    6,995
    Likes Received:
    19
    Many times. They keep saying they haven't done anything about it yet; they don't seem to have any detectable interest in improving it.
     
    #49

Share This Page