Page 1 of 1

Contextual help for T-filter, bad example

Posted: Thu Dec 30, 2010 8:45 pm
by dfhtextpipe
The contextual help for T-Filter reads as follows:
Found under Filters\Special

The T-Filter allows you to process the same input in a number of ways.

Let's say you wanted to first count the number of blank lines in your text and save this value to a new file/clipboard or capture variable, and then sort the text removing duplicate lines.

You would add a T-Filter, and as a subfilter of it, you would place the filters to identify blank lines (e.g. a restrict to matching lines with pattern text of '^$'), a count lines filter and the appropriate output filters such as a Secondary Output filter.

Once this side of the T has finished processing, the data is discarded, and the original text continues processing just as though the T-Filter did not exist.
Surely '^$' no longer matches a blank line!

cf. Using ^$ in a replace filter and doing a trial run does not change anything.

Re: Contextual help for T-filter, bad example

Posted: Mon Jan 03, 2011 11:49 am
by DataMystic Support
^$ in a search/replace has zero length and therefore is not treated as a valid match, since it could replace forever without consuming any input.
^$ in a line match is the only way of specifying a empty line, and is quite valid.