Re: Imported text is converted to date



Unfortunately, I believe the configurable text importer also fails in the same way.
With the attached .csv file I get identical results either by automatic importation
or by using the configurable text importer (setting " as the text indicator).

The text indicator has nothing to do with this.

On the third page, select "Text" instead of "General".

Morten




On Thu, Mar 27, 2014 at 6:58 PM, Rex Couture <rex wustl edu> wrote:
    Thanks for your helpful comments.  I've looked at the problem some more,
and I understand it better now.

    Unfortunately, I believe the configurable text importer also fails in
the same way.  With the attached .csv file I get identical results either by
automatic importation or by using the configurable text importer (setting "
as the text indicator).

    I think the .csv specification is not the source of the problem, and
neither is text importation.  The problem is that Gnumeric always interprets
a string such as 10.24.2 as a date unless it is preceded by a single quote '
.  This is true for either manual (keyboard) input or text import.  If I
enter 10.24.2 into a blank cell, Gnumeric interprets that as a date unless I
precede it with an apostrophe.  I did not find an actual specification for
entering dates, but the Help document has many examples, and this format
(with periods) is not one of them.

    For text import this behavior does not work if a delimiter is intended
as part of the string.  For example, in the attached .csv file, importing
the first and second lines fails if commas are intended as part of the
string.  In the third and fourth lines of the attachment, Gnumeric
recognizes "10.24.2, 3.7" as a string, but again it interprets "10.24.2" as
a date (use " as the text indicator).  For my own application I can work
around it easily, but I didn't find a general workaround.  To import strings
like that I suppose one could use tab-delimited files, but the undesirable
effect is that the file import method must depend on the strings.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]