Grep filter and countMatches

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

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: 2139
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia

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

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.

Simon Carter, - Insulin dose calculator for Type 1 diabetes - 250,000 free software downloads - send huge email attachments

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

Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 2 guests