roskakori / cutplace

validate data stored in CSV, PRN, ODS or Excel files
http://cutplace.readthedocs.org/
GNU Lesser General Public License v3.0
18 stars 20 forks source link

check errors get reported as a non-existent column #42

Closed roskakori closed 12 years ago

roskakori commented 12 years ago

Original request by SourceForge user nougat98:

let's say I have 17 fields, and checks at the end of my icd like:

C,filename must be unique,IsUnique,Filename,,,

These checks get reported for "column 18", which doesn't actually exist.

Row check failed: filename must be unique: tmpaCF0y7 (R4C18): unique [Filename] has already occurred: [dir2/test2-1.dat](see also: tmpaCF0y7 %28R3C18%29: location of previous occurrence) (row 4)

This is misleading if we are trying to coalesce repeated errors or otherwise use those Row-Column units. If the error could be simply R3C* or something it would be easier to handle.

roskakori commented 12 years ago

I can see your point, the location currently reported is confusing.

However, using a dummy location like R4C* doesn't seem particular helpful either because tools parsing the location in order to position the cursor will have to consider this syntax too.

I'm currently tending to let a failed row check report the error in the 1st column, for example R4C1. This would position the cursor at the beginning of the row, where the user can start his analysis.

roskakori commented 12 years ago

Implemented as described in comment above and scheduled for release with version 0.7.1.