[Kmymoney-devel] [Bug 299637] Difficulty importing small CSV file following large file, using same profile.

allan agander93 at gmail.com
Tue May 8 21:31:53 UTC 2012


https://bugs.kde.org/show_bug.cgi?id=299637

--- Comment #2 from allan <agander93 at gmail.com> ---
Presently, I obtain the actual number of lines in the file, and subtract from
this the saved  number of trailer lines.  The resulting 'last line' value gets
loaded into the UI, and the remainder get dropped.  The unfortunate consequence
of this is that if the saved  number of trailer lines is greater than or close
to the actual number of lines in the next file,(using that same profile), then
all or most of that file will get dropped.  Ironically, if, as originally done,
it were the user's input last line that was saved, then this current problem
couldn't arise.

Almost invariably, there is just one trailer line, so what I'm contemplating is
to limit the saved trailer lines to perhaps just a maximum of two or three, so
that it is more likely that a subsequent small file is less likely to get
decimated.  Better still, perhaps, is to ignore the trailer lines setting if it
is greater than the true last line, so that the full file is read in. 

I've now tried this later suggestion and it looks promising, so far.

Going back to the symptoms of this bug, rathet than the cure, the situation can
be even worse.  To attempt to avoid an incorrect choice of field delimiter, I
have in place a check for the number of columns detected, the rationale being
that an incorrect choice is likely to curtail the number of columns.  If this
check fails, it's impossible to advance from the field delimiter page. 
Selecting the correct delimiter was expected to solve that situation.  However,
if the trailer line issue results in just a single line being imported, and if
that line has, say, just a date stamp, then there is no chance to proceed at
all.

The new method handles this, too.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the KMyMoney-devel mailing list