Bug 69050 - Calc: Import CSV dates are no longer recognized when check 'Detect Special Characters' is set
Summary: Calc: Import CSV dates are no longer recognized when check 'Detect Special Ch...
Status: CLOSED DUPLICATE of bug 68437
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.1.0.0.beta1
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2013-09-06 19:06 UTC by crxssi
Modified: 2013-11-21 21:03 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample CSV import file (80 bytes, text/csv)
2013-09-06 19:07 UTC, crxssi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description crxssi 2013-09-06 19:06:52 UTC
Calc no longer automatically detects dates in a CSV file import as dates, even when the "Detect Special Characters" is set to "on".

Steps to reproduce:

* Open the sample import.csv file
* Choose Separated by Comma
* Look at the first column, they are not dates (you can prove it with formulas or formatting)

This was never a problem in OO, or in LibreOffice up through and including 4.0.2.  It appears to be a regression as of 4.1.0, and is still a problem in 4.1.1.

The only workaround is to manually tag each date field as a date when importing, which is very time consuming if you are importing many date fields (and very confusing for those who never had to do this before).

I also tested various date formats in the import file,  MM/DD/YYYY, MM/DD/YY, YYYY/MM/DD, and YYYY-MM-DD, didn't matter- none of them worked.  Language: "Default - English (USA)"
Comment 1 crxssi 2013-09-06 19:07:40 UTC
Created attachment 85369 [details]
Sample CSV import file
Comment 2 Cor Nouws 2013-09-06 21:58:13 UTC
Hi

For me, 4.1.1.2 on Ubuntu, selecting MDJ for column one, it just imports as dates..
So I cannot confirm what you see, sorry.
Comment 3 crxssi 2013-09-06 23:27:24 UTC
(In reply to comment #2)
> For me, 4.1.1.2 on Ubuntu, selecting MDJ for column one, it just imports as
> dates..
> So I cannot confirm what you see, sorry.

If you are manually selecting a date format, then yes it works.  But you are not supposed to have to manually tag anything as a date, it should automatically detect that it is a date if the "Detect Special Characters" is active.  But it doesn't.  That is what is broken...

(Even if all columns say "Standard" in the text import dialog, it should automatically detect dates if "Detect special characters" is selected".  It no longer does this)
Comment 4 m_a_riosv 2013-09-07 13:30:05 UTC
Hi crxssi,
CSV file is formed in Englis-US format, if you select the language as English-US in the import window, then all is correctly imported, at least for me.
Comment 5 crxssi 2013-09-07 15:05:02 UTC
(In reply to comment #4)
> Hi crxssi,
> CSV file is formed in Englis-US format, if you select the language as
> English-US in the import window, then all is correctly imported, at least
> for me.

As I indicated in the bug report, I was using English-US.  It doesn't matter if I leave it at the default "Default- English (US)" or select "English (US)", the result is the same- no automatic dates.  Also tried different encoding (other than the default Unicode UTF-8) and that makes no difference.

-----

Prior testing only on Fedora 17 32bit and RHEL 6.1 64bit.  Added more testing today, here is the total summary so far:

Pass:  RHEL 6.1 64bit,  OO 3.2.1
Pass:  RHEL 6.1 64bit,  OO 3.4.1
Pass:  Fedora 18 64bit, LO 3.6.7.2
Pass:  Fedora 17 32bit, LO 4.0.2
Pass:  Mageia 3 64bit,  LO 4.0.4.2
FAIL:  RHEL 6.1 64bit,  LO 4.1.0.X
FAIL:  Mageia 3 64bit,  LO 4.1.0.4
FAIL:  RHEL 6.1 64bit,  LO 4.1.1.2
FAIL:  Fedora 18 64bit, LO 4.1.1.2
FAIL:  WinXP2 32bit VB, LO 4.1.1.2
Comment 6 Markus Mohrhard 2013-09-07 15:18:40 UTC
I can't reproduce this in a master build.
Comment 7 tmacalp 2013-09-07 18:40:56 UTC
I can confirm this under Win32 4.1.0.4 and Win32 4.1.1.2.  I loaded an old version (3.5.7.2) under 64bit Fedora17 and it worked properly.

From some of the comments, it sounds like people aren't following the original instructions and are actually modifying the column to be type "date."  From the original post:

"The only workaround is to manually tag each date field as a date when importing, which is very time consuming if you are importing many date fields (and very confusing for those who never had to do this before)."

To repeat, when importing the csv, all you need to do is ensure that "detect special numbers" is checked.  Leave the first column set to "Standard".

After that, you'll notice the column's format is set to "text," the dates will be aligned on the left side instead of the right, and if you auto-fill off of the last date, it will simply increment the year.
Comment 8 Cor Nouws 2013-09-08 09:17:03 UTC
@tmacalp I can confirm that in 3.5.7 indeed the csv dates import with the correct formatting without choosing a date patern for the column. 
Do not need to choose En-GB as language.

But pls note that crxssi wrote " I also tested various date formats in the import file,  ...  didn't matter- none of them worked ".
And since I always set the date pattern, I did not test in other versions.
Comment 9 crxssi 2013-09-08 13:04:43 UTC
(In reply to comment #8)
> @tmacalp I can confirm that in 3.5.7 indeed the csv dates import with the
> correct formatting without choosing a date patern for the column. 

Does that mean you now also confirm that it is broken in 4.1?
Comment 10 Cor Nouws 2013-09-08 18:27:11 UTC
(In reply to comment #9)

> Does that mean you now also confirm that it is broken in 4.1?

(Now reading what the _intention_ of the check 'Detect Special Characters' ..): yes. It does show as a date, but the cell formatting is text.
First that I can see the bug is 4.1.0 beta 1 (do not have the alpha)

Sorry for the initial confusion & misunderstanding on my side!

@eike: something you have an idea about?

Cor
Comment 11 Eike Rathke 2013-09-09 12:36:45 UTC
sure.. ;-)

*** This bug has been marked as a duplicate of bug 68437 ***
Comment 12 crxssi 2013-09-09 14:04:15 UTC
(In reply to comment #11)
> sure.. ;-)
> 
> *** This bug has been marked as a duplicate of bug 68437 ***

In the other bug there is no mention of dates but it seems to imply that the "Detect Special Numbers" was being completely ignored (which would affect dates too) and it is already fixed.  Is this correct?
Comment 13 Cor Nouws 2013-09-09 14:55:57 UTC
(In reply to comment #12)

> In the other bug there is no mention of dates but it seems to imply that the
> "Detect Special Numbers" was being completely ignored (which would affect
> dates too) and it is already fixed.  Is this correct?

Indeed, I see that import works fine in 4.1.2.1 (1st release candidate of 4.1.2)
Comment 14 crxssi 2013-10-07 14:51:05 UTC
I can confirm this is fixed in LO 4.1.2.3!  Thanks!