After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 80806 - Enabling "Adjacent text indicators escaped" doesn't always work with CSV import
Enabling "Adjacent text indicators escaped" doesn't always work with CSV import
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: import/export Text
1.0.x
Other other
: Normal normal
: ---
Assigned To: Andreas J. Guelzow
Andreas J. Guelzow
: 105853 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2002-05-04 19:24 UTC by lukeh
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description lukeh 2002-05-04 19:24:44 UTC
Enabling "Adjacent text indicators escaped" should allow for a string like
"apples ""pears"" oranges" to be escaped.  As it is, the following file:

---
"apples ""pears"" oranges"
"Friends, ""Romans"", countrymen, ""lend me your ears""",xyz 
---

is interpreted as the following without the option selected, in the second
screen of the import druid ("Separation Customization"):

+-------------------------+-----------+------------------------------+

|apples "pears"" oranges" |           |                              |
+-------------------------+-----------+------------------------------+
|Friends, "Romans""       |countrymen |""lend me your ears""" xyz    |
+-------------------------+-----------+------------------------------+

After clicking "Next", in the third step ("Column Formatting"), with the
option to escape adjacent '"'s still unselected, the third column suddenly
is separated out into two columns (and that's what the final spreadsheet
looks like)--quirky behaviour!:

+-------------------------+-----------+-----------------------+-------+

|apples "pears"" oranges" |           |                       |       |
+-------------------------+-----------+-----------------------+-------+
|Friends, "Romans""       |countrymen |""lend me your ears""" |xyz    |
+-------------------------+-----------+-----------------------+-------+

With the option to escape adjacent separators selected, the second import
screen becomes:

+-------------------------------------------------------+

|apples "pears"" oranges"                               |
+-------------------------------------------------------+
|Friends, "Romans", countrymen, "lend me your ears" xyz |
+-------------------------------------------------------+

and the third option screen becomes:

+---------------------------------------------------+----+

|apples "pears"" oranges"                           |    |
+---------------------------------------------------+----+
|Friends, "Romans", countrymen, "lend me your ears" |xyz |
+---------------------------------------------------+----+

As you can see, the second options screen is doing something strange, but
it's corrected in the third screen.  The big problem though is that when
double-quote escaping is enabled, it only works after a whitespace char (or
something like that--see '"pears""' in the last example).

There are some additional problems I see though:



, neither is correct, although some situations are ambiguous and "correct"
is debatable.

 would interpret
Comment 1 lukeh 2002-05-04 19:31:25 UTC
Sorry, I accidently sent that while I was editing the end of it.  To
continue...:

There are some additional problems I see though:
-- Double-quote-enabling should be on by default.  Even if it comes up
as default when the dialog-box is opened, it is not enabled if a CSV
file is double-clicked on for automatic import.
-- There should be a sensible default way of handling double-quotes
when the option is disabled.  I would suggest that C's way of doing
this might make the most sense:  ("a b c"   "d e f") is interpreted as
("a b cd e f") and ("a b c "" d e f") is interpreted as ("a b c  d e
f"), i.e. adjacent quoted strings are concatenated.
-- (Slightly unrelated:) Doing a text import of a CSV file should
automatically select comma as the default separator.  This works for
double-click import, but not Import from the File menu.
Comment 2 Jody Goldberg 2002-12-28 07:57:40 UTC
Reassigning with the other stf bugs
Comment 3 Andreas J. Guelzow 2003-05-06 13:38:18 UTC
*** Bug 105853 has been marked as a duplicate of this bug. ***
Comment 4 Andreas J. Guelzow 2003-05-07 05:42:10 UTC
This has finally been fixed in cvs head (with the exception of
automatically setting comma as the separator in teh configurable text
import).

Since the main bugs are fixed, I am closing this report. (I will
preselect comma when we review the dialog code.)