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

TPIPE /selection

Discussion in 'Support' started by vefatica, Jun 3, 2012.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,959
    Likes Received:
    30
    At least I can get it to do something now (with build 20). But I don't think it can do what I want (what CUT.EXE does), namely select the fields/columns to be output ... like this
    Code:
    v:\> echo My dog has fleas. | g:\gnu\cut.exe -f2 -d " "
    dog
    If I read the help correctly, it can only move, copy, and remove. Outputting the selected fields seems more useful.
     
  2. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    I agree, esp. since you may not know how many fields a line contains that you would need to remove to be left with only those of interest. It needs a selection syntax that is analogous to @WORD: %@remove[separator,3-9999,string] ...
     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,959
    Likes Received:
    30
    The syntax for CUT.EXE is quite simple and goes well beyond that. For example, the spec "-f2,7-9,13,15-" will give (output) fields 2, 7 through 9, 13, 15, and thereafter; likewise for characters (-c).
     
  4. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    I was referring to what syntax TPIPE needs to be a superset of CUT.
     
  5. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,860
    Likes Received:
    83
    There are two ways to do it:

    1) Use the select filter and a subfilter (but I haven't documented the subfilters yet).
    2) Use two select filters. (This is the easiest and just as fast.)
     
  6. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,959
    Likes Received:
    30
    I don't know what you're up against but doesn't the interface to the "selection" action have an "extract" option?

    I hope subfilters are very powerful. With CUT.EXE, "-f2,4,6,8,10" will output precisely those five fields. Would I have to use *six* TPIPE selection filters to get rid of the ones Idon't want? That alone would be a couple hundred characters

    I'm just playing with TPIPE. With seven text utils (grep, sed, wc, sort, tr, cut, egrep) I can do just about anything I want. I'd like to see TPIPE replace all of those and be super-fast but I doubt it will and I don't process enough data to get back the time I'd spent composing TPIPE commands. I suppose anyone who will use TPIPE regularly will have quite a collection of aliases

    Are you going to be the go-between when the TextPipe engine doesn't do what it's supposed to? Will those folks be as timely as you when it comes to bug fixes? What ever happened to TPIPE /sort? I'll bet the recently discovered bug in TPIPE /grep (counting matches) isn't yours.
     
  7. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,860
    Likes Received:
    83
    No. If it did, it would be listed in the TPIPE /selection documentation.

    Why would TPIPE & the TextPipe engine be any different from any other Windows or third-party dll that Take Command uses? You don't communicate directly with the Microsoft or third-party developers for any other dll.

    I already said that TPIPE /sort would not be in the 14.0 release.
     

Share This Page