Grep filter and countMatches

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

rconn
Posts: 32
Joined: Wed Feb 29, 2012 11:56 pm

Grep filter and countMatches

Postby rconn » Mon Jun 04, 2012 12:57 pm

Hi Simon:

Not sure if this is confusion in the documentation or something wrong with the Grep filter:

Using the TextPipe Engine, I'm calling addGrepFilter with "countMatches=1". The help says:

countMatches - true to only output a count of the number of matches, default False

But what it actually does is print out all of the matching (or non-matching, depending on "type") lines, and then print the countMatches result at the end.

Is this WAD? If so, is there a way to print JUST the countMatches value without all the matching/nonmatching lines?

User avatar
DataMystic Support
Site Admin
Posts: 2154
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Grep filter and countMatches

Postby DataMystic Support » Thu Jun 21, 2012 3:40 am

Hi Rex,

It sounds like you are using a type of 0 or 1, instead of a type of 3 or 4:

Code: Select all

type:
0 Restrict lines matching
1 Restrict lines NOT matching
2 Extract matches
3 Extract matching lines (grep)
4 Extract non-matching lines (inverse grep)
5 Remove matching lines
6 Remove non-matching lines


Types 0 and 1 will return every single match to the filters inside the restriction, which then modify those matching lines further.

Types 3 and 4 will remove all non-matching text.
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: No registered users and 4 guests