csv import: fails to parse dates

Bug #1093139 reported by frankster
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
gnucash (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Importing a csv file with a date column containing dates of the form "14 Sep 12" fails in gnucash 2.4.11

To reproduce:

* create a csv file containing the following text:
14 Sep 12, Payment By Direct Debit ,Mr X Xxxx,,"-9,999.99",
* import this file into gnucash
* select date format d-m-y
* click import
* gnucash gives the error "The date column could not be understood" on every single row.

$ apt-cache policy gnucash
gnucash:
  Installed: 1:2.4.11-1
  Candidate: 1:2.4.11-1
  Version table:
 *** 1:2.4.11-1 0
        500 http://archive.ubuntu.com/ubuntu/ quantal/universe amd64 Packages
        100 /var/lib/dpkg/status

Revision history for this message
Micha Lenk (micha) wrote :

Do you really intend to add a transaction that is more than 2000 years old?

Revision history for this message
frankster (wtfrank) wrote :

I can also reproduce the issue with a csv file containing the following text:

14 Sep 2012, Payment By Direct Debit ,Mr X Xxxx,,"-9,999.99",

Revision history for this message
frankster (wtfrank) wrote :

Also reproducible with:

14/Sep/2012, Payment By Direct Debit ,Mr X Xxxx,,"-9,999.99",

Revision history for this message
Micha Lenk (micha) wrote :

As you selected the date format d-m-y, did you ever try it with '14-09-2012' in the date field? This is what I would expect to work. The other formats you tried seem to lack the dashes.

Revision history for this message
frankster (wtfrank) wrote :

Seems odd if date formats are only supported with one particular separator

Revision history for this message
Micha Lenk (micha) wrote :

Well, it is the separator used in the explicitly selected date format.

Changed in gnucash (Ubuntu):
status: New → Invalid
Revision history for this message
frankster (wtfrank) wrote :

It doesn't import the dates in the csv file provided by my bank. If it is only designed to import dates that use a specific separator then this is a bug with the specification, rather than the implementation. Either way, it is a reasonable user expectation that the programme will import a csv file provided by a bank without having to edit the file by hand. So its not appropriate to mark this bug as invalid.

Changed in gnucash (Ubuntu):
status: Invalid → New
Revision history for this message
SHULTZIE (bibleworship101) wrote :

I AGREE WITH: frankster (wtfrank) wrote on 2013-02-17: #7

It doesn't import the dates in the csv file provided by my bank. If it is only designed to import dates that use a specific separator then this is a bug with the specification, rather than the implementation. Either way, it is a reasonable user expectation that the programme will import a csv file provided by a bank without having to edit the file by hand. So its not appropriate to mark this bug as invalid.

I TOO AM HAVING A PROBLEM WITH GNUCASH DATES AND CSV IMPORTS. I tried MM/DD/YY, and MM/DD/YYYY and MM-DD-YYYY

RE: POOR EFFORT (To be funny ) BY: Micha Lenk (micha) wrote on 2012-12-22: "Do you really intend to add a transaction that is more than 2000 years old?"

SUGGEST: You earn your priviledge to make jokes by offering something constructive (like a solution) alongside your efforts to be funny. (Otherwise people see you as just another wiseguy.)
Here is an original SHULTZIE that you can add to your repetoir (Use it when you bomb)
                                  "Do you know the hardest part about trying to be funny?..... Failing!"

RE: SOLUTIONS: Has anyone found a date format that works?
At this point I don't care if I have to fix it by hand (though I think the community should consider this problem is a bug).

Revision history for this message
Micha Lenk (micha) wrote :

Hi,

first I feel sorry that I seem to have offended frankster (wtfrank) in my earlier notes in this bug. Yes, my question in note #1 was not helpful at all, and I now regret that I wrote it at all. For me it was obvious that the date format d-m-y means exactly this: A string composed of three groups of digits separated by dashes. This format is so common in the IT industry that I thought my brief notes were enough to understand the problem. So please accept my apologies for not taking enough time to write an answer with an end user and not an IT expert in mind.

Regarding the user expectation that Gnucash should import whatever format the banks provide, please note that there are so many calendar date formats in use all over the world that it is almost impossible to always parse a string representation of any calendar date correctly. If a bank decides to invent yet another date format (I consider separating the numbers with spaces odd), please contact your bank and ask them to fix the CSV export. This is not really a Gnucash issue, which is why I changed the status to 'Invalid' in note #6. Sorry for not explaining it at that time.

Back to the issue this is all about: In note #5, frankster (wtfrank) does not explicitly answer my question whether the import works when using a dash as a separator. When I wrote note #6, I assumed that it does. SHULTZIE, in note #8 you wrote that you have too issues with importing CSV files, even when using a dash as a separator. Is this correct? Unfortunately I can't try it on my own as I have no such CSV file. So, frankster and/or SHULTZIE, could you please confirm that it works with a dash as separator (at least if the CSV data adhere to the selected order of day, month and year)? Alternatively, can you please provide a test file and more precise instructions how to reproduce the issue?

I hope all this helps to get to a better resolution of this issue. But if anybody could provide the requested information, I am sure we will find a resolution that everybody can agree with.

Regards,
Micha

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnucash (Ubuntu):
status: New → Confirmed
Revision history for this message
Florian Schüller (schuellerf) wrote :

Hi!
I had a similar problem and ended up in patching the source until I found that it was a "user error" due to a bad error message...

In my case the sole problem was the "headline" of the CSV!
I just had to set "Start input on row" during import to "2"
I'm not sure if this fixes your problem but I'm always optimistic...

For me it was confusing that the preview window of the CSV data skips the headline (of the CSV) but then complains about the headline-text not being a date.

(if this is important I use Ubuntu 14.04, gnucash 2.6.1)

Regards
Florian
ps I created a pull request for an improved error message on github...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.