Page 1 of 1

List index out of bounds (-1) error

Posted: Mon Jun 24, 2013 5:20 pm
by dfhtextpipe
This error occurs when a line to be processed does not end with the specified delimiter,
and when the filter is Move fields: #-delimited field END-1..END-0 move to 1

The error is a show-stopper, as it interrupts the processing of the rest of the input file.

In the attached filter, suitable lines are in the trial run area.

I have included examples with both # and comma as delimiters, with lines both with & without the final delimiter.

It matters not what kind of delimiter is specified,
apart from the fact that this can influence how many lines are processed (if any).

Re: List index out of bounds (-1) error

Posted: Mon Jun 24, 2013 5:23 pm
by dfhtextpipe
The error occurs only when Move fields is the filter type.

When one is copying a field [say] to the end of a line, there is no such error,
even when the line does not terminate with the specified delimiter.

Re: List index out of bounds (-1) error

Posted: Tue Jun 25, 2013 12:22 am
by dfhtextpipe
Meanwhile, an obvious workaround to avoid this critical error is to add a right margin to the lines to be processed.

The right margin should just contain the specified field delimiter.

This can be readily removed after the lines have been processed.

Re: List index out of bounds (-1) error

Posted: Fri Jun 28, 2013 12:46 pm
by DataMystic Support
Thanks David,

Fixed ready for v9.5 today or Monday.

Re: List index out of bounds (-1) error

Posted: Thu Jul 04, 2013 6:21 pm
by dfhtextpipe
Thanks. Just installed v9.5

David

Re: List index out of bounds (-1) error

Posted: Sat Jul 06, 2013 12:45 am
by dfhtextpipe
Simon,

Thanks. The list index error issue has been fixed, but .....

Now that I've updated to version 9.5, I decided to test the same trial run filter.

On line 3, two fields are moved from the end, even though only one field should have been.
Trial run test for delimiter #
Trial run test for delimiter #
Likewise, if you use comma as the delimiter, the same kind of bug occurs for the last line.

This is now a critical issue, because it will alter the behaviour of existing filters that move fields from the end.

David

Re: List index out of bounds (-1) error

Posted: Mon Jul 15, 2013 3:24 pm
by DataMystic Support
END-1 .. END-0 actually specifies two fields, not one.

Having a trailing delimiter on a line is actually an empty field.

Re: List index out of bounds (-1) error

Posted: Mon Jul 15, 2013 5:22 pm
by dfhtextpipe
The question is more to do with backwards compatibility.

Please check whether before the out of bounds error was fixed, if moving END-1 ... END-0 used to move two fields or only one.

If the programming error also caused only one field to be moved before, then users need to be alerted.