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

TPIPE matching problem

Discussion in 'Support' started by David McClelland, Jan 9, 2014.

  1. David McClelland

    Joined:
    Jun 4, 2008
    Messages:
    19
    Likes Received:
    0
    I have a text file:
    1058 No white space at start of line
    bbbb1058 white space at start of line

    Note: the bbbb in the above line represents blanks

    I issue the command:
    tpipe /input=test.txt /grep=3,1,0,0,0,0,0,0,^1058

    and get

    1 1058 No white space at start of line
    2 bbbb1058 white space at start of line

    Next do the command:
    perl.exe -e "while (<STDIN>) {print $_ if m/^1058/"} <test.txt

    and get:

    1058 No white space at start of line

    The second line does not get printed. It looks like tpipe is not handling the start of line matching character (^) the same way as perl does.

    I am using ActiveState Perl:
    This is perl 5, version 16, subversion 2 (v5.16.2) built for MSWin32-x64-multi-thread

    TCC version is
    TCC 15.01.52 x64 Windows 7 [Version 6.1.7601]

    Is this considered a bug?

    David McClelland
     
  2. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,959
    Likes Received:
    30
    The TCC escape character '^' is not protected in this command as it is in the Perl command.
    Code:
    tpipe /input=test.txt /grep=3,1,0,0,0,0,0,0,^1058
    Either double the '^' or quote the regex.
    Code:
    v:\> type test.txt
    1058 No white space at start of line
      1058 white space at start of line
    
    v:\> tpipe /input=test.txt /grep=3,1,0,0,0,0,0,0,^1058
    1 1058 No white space at start of line
    2  1058 white space at start of line
    
    v:\> tpipe /input=test.txt /grep=3,1,0,0,0,0,0,0,^^1058
    1 1058 No white space at start of line
    
    v:\> tpipe /input=test.txt /grep=3,1,0,0,0,0,0,0,"^1058"
    1 1058 No white space at start of line
     
  3. David McClelland

    Joined:
    Jun 4, 2008
    Messages:
    19
    Likes Received:
    0
     
  4. David McClelland

    Joined:
    Jun 4, 2008
    Messages:
    19
    Likes Received:
    0
    Should have thought of that! :-)

    Thanks for your reply
     

Share This Page