List index out of bounds (-1) error

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
dfhtextpipe
Posts: 988
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

List index out of bounds (-1) error

Post 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).
Attachments
Move delimited field from END.zip
Simple filter to process the trial run data
(671 Bytes) Downloaded 702 times
David
dfhtextpipe
Posts: 988
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

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

Post 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.
David
dfhtextpipe
Posts: 988
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

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

Post 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.
David
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

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

Post by DataMystic Support »

Thanks David,

Fixed ready for v9.5 today or Monday.
dfhtextpipe
Posts: 988
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

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

Post by dfhtextpipe »

Thanks. Just installed v9.5

David
David
dfhtextpipe
Posts: 988
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

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

Post 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
David
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

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

Post 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.
dfhtextpipe
Posts: 988
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

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

Post 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.
David
Post Reply