https://bugs.documentfoundation.org/show_bug.cgi?id=152336
Bug ID: 152336
Summary: Improve CSV field separator detection/behavior when
several separators are selected on import
Product: LibreOffice
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: enhancement
Priority: medium
Component: Calc
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Blocks: 109239
When opening a text (CSV, TSV, ...) file in Calc, the import dialog allows to
select several field separators, and three of those (tab/comma/semicolon) are
selected by default. This allows to have some sort of "autodetection" for
simple cases. It also allows importing less structured data, actually having
different separators simultaneously.
However, this has a drawback: this multiselection makes the program use
"random" one of those upon save. So, when one opens a TSV, without unchecking
the other options in the import dialog, and saving using File->Save, the result
would be not TSV, but CSV.
This proposal is to implement two improvements over the current behavior:
1. When importing, Calc should keep an internal record, which of the selected
separators were actually encountered. Upon the import end, it should filter out
the unused separators from the filter settings stored in the document's media
descriptor. For most important cases, this would already allow to detect the
actually used separator, and avoid further user interactions.
2. When after #1, several separators were marked used (usually that would mean
some complex data that had the characters selected as possible separators, so
the import was actually wrong, and to have it right, the user needs to
re-import with wrong separators unselected), then saving this file should ask
user about the options, just as it does when user saves a new document to CSV
(i.e., when there's no CSV filter settings in the media descriptor yet).
Indeed, the dialog should gather the information from the existing media
descriptor; and it may use some heuristics which field separator to suggest to
user (e.g., it may count encountered separators on import, and choose the most
used one in the export dialog) - but the forced dialog would not only prevent
silent unexpected results, but also give a hint about some possible import
problems. And in case of unstructured original data, having to manually select
the separator out of several actually used is a reasonable requirement.
(The import problems in #2 could also show an infobar, so user would be
notified immediately on opening, without the need to wait when one edits the
data, then decides to save, and sees the dialog, at which point they may have
no clue that the dialog means that the import was wrong, and also that they
need to re-do all the work they done... but that is a topic for a separate
request.)
Referenced Bugs:
https://bugs.documentfoundation.org/show_bug.cgi?id=109239
[Bug 109239] [META] CSV import and export dialog bugs and enhancements
--
You are receiving this mail because:
You are the assignee for the bug.