Bug 140010 - Export as CSV should always "quote" Text fields
Summary: Export as CSV should always "quote" Text fields
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.2.0.0.alpha0+
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-29 23:39 UTC by Jim Avera
Modified: 2021-01-30 20:15 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
test.ods (see steps to reproduce) (9.44 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-01-29 23:41 UTC, Jim Avera
Details
screenshot (31.48 KB, image/png)
2021-01-30 06:27 UTC, BogdanB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Avera 2021-01-29 23:39:51 UTC
Description:
When importing from CSV, the "Format quoted fields as text" provides a way to distinguish text from numeric fields.

However the corresponding export-to-CSV feature is missing: There is no way to generate a CSV with Text fields quoted.  So the format gets lost in a round-trip from spreadsheet to CSV and back to spreadsheet (often needed to use text-oriented tools to manipulate the data).

IMO exporting to CSV should, by default quote fields which have Text (not numeric) format even if they don't contain special characters (for example numers).

Steps to Reproduce:
1. Load attached demo.ods spreadsheet; verify that the format of A2 is Text and B2 is Number(General)
2. File->Save As... change file Name and set output drop-down to Text CSV(.csv)
3. File->Open...  navigate to the saved .csv file
     Check "Format quoted field as text"
4. Check format of A1 (rightclick->Format Cells...->Numbers:Category)

Actual Results:
A2 has numeric format in the imported document, rather than Text

Expected Results:
Export should have quoted A2 because it was Text, so it could be imported as Text


Reproducible: Always


User Profile Reset: No



Additional Info:
.
Comment 1 Jim Avera 2021-01-29 23:41:08 UTC
Correction to Step 4 above: Check format of A2 (not A1)
Comment 2 Jim Avera 2021-01-29 23:41:38 UTC
Created attachment 169289 [details]
test.ods (see steps to reproduce)
Comment 3 BogdanB 2021-01-30 06:27:18 UTC
Created attachment 169291 [details]
screenshot

I tested with Version: 7.2.0.0.alpha0+ / LibreOffice Community
Build ID: f2389a70da606768a39ee599de6a5b24058734aa
CPU threads: 4; OS: Linux 5.8; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded

And everything is ok.

Don't forget at step "Save as" to check "Quote all text cells". See the screenshot.
Comment 4 Jim Avera 2021-01-30 19:36:37 UTC
Right you are.  I mis-read that option as "quote all cells".  Thanks for the correction.

Closing