GNOME Bugzilla – Bug 80806
Enabling "Adjacent text indicators escaped" doesn't always work with CSV import
Last modified: 2004-12-22 21:47:04 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
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.
Reassigning with the other stf bugs
*** Bug 105853 has been marked as a duplicate of this bug. ***
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.)