Page 1 of 1

Restrict to lines filter - confusing terminology in help

Posted: Wed Feb 21, 2018 1:49 am
by dfhtextpipe
Hi Simon,

The Restrict to lines filter help page includes:
Specification

The lines can be specified in a number of ways. See Field specifications.

You can separate line numbers with spaces or commas, and ranges with ..

1. Start line, end line. This processes all lines including and between the specified lines. e.g. 1..7

2. Start line, width. Processes lines starting from (and including) line Start. e.g. 10 .. +3 processes 3 lines starting from line 10.

3. End line, width. Processes Width lines backwards starting from (and including) line End. e.g. -4 .. +3 processes 3 lines starting from 4 lines before the end of the line.

4. Start line to end of line. Processes all lines from the Start line to the very end of the line. e.g 5 .. -2 processes lines starting from line 5, and stopping 2 lines from the end of the line.

5. Width to end of line. Processes Width lines backwards starting from (and including) the last line e.g. -10 .. +2 processes 2 lines starting from the line 10 before the end of the line.

This filter only allows a single range to be specified.
IMHO, the terminology is confusing in your use of "to end of [the] line" when you really mean "to end of [the] file" or merely "end line".

Aside: It was much easier to program the older UI for this filter. The UI change was not an improvement.

Please review the help text for this and similar filters that use a line range.

Best regards,

David

PS
Processes Width lines backwards
is also confusing, as TextPipe does not process these lines in reverse order.

Re: Restrict to lines filter - confusing terminology in help

Posted: Wed Feb 21, 2018 2:06 am
by dfhtextpipe
One of my very old filters (made with the original UI) contains the subfilter that now displays as:

Code: Select all

Restrict to lines: 2 .. -1
As my original intention was merely to exclude line 1, it's hard to understand why TextPipe v10.0 converted the sub-filter data to show the end line: -1

As I read the Help page, despite its confusing terminology, this seems to imply that it should stop processing 1 line before the end of the file.

Yet there was never any design in my original filter to exclude the last line of the file. It was always to be included.

This example illustrates why the help page is so confusing.

David

Re: Restrict to lines filter - confusing terminology in help

Posted: Wed Feb 21, 2018 2:12 am
by dfhtextpipe
Consider for illustration purposes an input file containing only 10 lines.

AFAICT, TextPipe field specifications UI numbers these lines as follows:

Code: Select all

Start	End
1	-10
2	-9
3	-8
4	-7
5	-6
6	-5
7	-4
8	-3
9	-2
10	-1
OK ?

Which lines (if any) would be processed under Restrict to lines: 6 .. -6 as the data for this filter ?

David

Re: Restrict to lines filter - confusing terminology in help

Posted: Thu Apr 26, 2018 10:21 pm
by DataMystic Support
None -as starting from line 6, and ending from line 4, there are no lines that meet this criteria unless the file has 12 or more lines.

Re: Restrict to lines filter - confusing terminology in help

Posted: Sun Apr 29, 2018 2:40 am
by dfhtextpipe
Simon,

Please also answer the points in the previous comments.

I still don't get how

Code: Select all

-1
appeared in

Code: Select all

2..-1
.

David