I am trying to extract line data from a text file into a detail table.
I am using a condition to limit the lines selected.
I want the 3 lines upto and including the line containing a certain tag.
Here is my condition setup.
The condition works fine in the middle of a page of data,
but fails when the target of the condition is at the end of the input page.
I suspect that the data selector (6,+0,12,+3) is not returning anything when there are fewer than 3 lines left on the page.
Is this the expected behaviour?
For your first issue, I’m not quite sure how you’re going at it because it works on my end.
But regardless, I think the proper way of doing this would be to loop through all lines (with the GOTO step inside the loop set to “next line with content”). Then your condition looks for the word “Price” and if it finds it, an Extract step can extract this line and the two previous ones by setting its Top offset property to -2.
As for your second issue (empty multi-line selections), you are right: it does indeed look like a bug. I have reported it to our development team and have asked them to fix it in a future version (unfortunately, it’s too late to include a fix in the version coming out this week).
Phil
Thanks
Firstly, sorry for putting 2 issues on 1 post - I resolve to try and stop doing that.
I have worked around the first issue, by looking for different data, extracting in another order etc.
But the underlying issue is still there - a condition that uses a data selector that extends beyond the page margins always returns false, regardless of the data. I think the detail loop is a distraction, so I have an example without looping.
Here is a condition that works -
Ah, I see now how to replicate the issue: the problem doesn’t occur over page boundaries inside the same document (which is what I tested previously) but it does occur at the end of a record, when the data selection extends beyond the last line of the record.
When you base that condition on Javascript, we can see that the equivalent statement generates a JS error, which explains why basing it on Position also fails. The negative offset is the same issue: as soon as the data selection extends beyond the Record boundary, an error is generated internally, preventing the condition from being evaluated properly.
Fortunately, as you mentioned earlier, the workaround is relatively easy, using JS code to trap the error.
Still I will report this issue to our team as well.