Project

General

Profile

Actions

Defect #7039

closed

CSV export. Line breaks. Excel

Defect #7039: CSV export. Line breaks. Excel

Added by John Yani about 16 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Issues
Target version:
-
Resolution:
Wont fix
Affected version:

Description

When I make csv export of issues and open the result in Excel, line breaks (CR/LF) in description field are not correctly displayed.


Files

Classeur1.csv (64 Bytes) Classeur1.csv Example CSV file Etienne Massip, 2011-03-22 17:30
csv_issue_description_eol.patch (604 Bytes) csv_issue_description_eol.patch IssueHelper change Etienne Massip, 2011-03-26 16:34
csv_text_fields_eol.patch (1.31 KB) csv_text_fields_eol.patch FasterCSV change Etienne Massip, 2011-03-26 16:34
Classeur1.csv (66 Bytes) Classeur1.csv CSV with CRLF in a cell Jean-Philippe Lang, 2011-03-27 19:39
excel2007.png (2.2 KB) excel2007.png Display in Excel 2007 Jean-Philippe Lang, 2011-03-27 19:39
excel2010.png (3.05 KB) excel2010.png Rolf Stetter, 2011-04-28 17:58
faster_csv.rb.patch (2.58 KB) faster_csv.rb.patch Patch that doesn't work Sven Müller, 2011-09-09 15:42

Related issues 3 (0 open — 3 closed)

Related to Redmine - Defect #7096: CSV Issues Export + Ruby 1.9 + Thin + non-ascii characters causes "invalid byte sequence in US-ASCII"ClosedActions
Related to Redmine - Feature #7037: CSV export encoding and excel. UTF-8 and BOMClosedJean-Philippe LangActions
Has duplicate Redmine - Defect #7958: Irregular CSV file (caused by "Description" field)ClosedActions

Updated by John Yani about 16 years ago Actions #1

Open Office Calc BTW handles it fine.
Excel version: 2007

Updated by Jonas Schulz almost 16 years ago Actions #2

Please review this bug, it is still open in version 1.1. The CR/LF issue in the description field will prevent the correct import under excel 07.

Are there any other chance to drop out that field without modification of the issues_helper.rb?

Thank you in advance!

Updated by Etienne Massip almost 16 years ago Actions #3

  • Category set to Issues
  • Affected version (unused) set to 1.1.0
  • Affected version set to 1.1.0

Updated by Etienne Massip over 15 years ago Actions #4

Data of cells containing line breaks in Excel 2003 is outputted the following way in the resulting CSV file :
  • cell content is surrounded by quotes
  • line breaks are LF only

Here's an example (separator is semi-colon).

Updated by Etienne Massip over 15 years ago Actions #5

  • Target version set to Candidate for next major release

Updated by Etienne Massip over 15 years ago Actions #6

2 patches :
  1. either simply replace \r\n EOLs with \n in issue description (IssueHelper change)
  2. or replace \r\n EOLs with \n in all text fields (FasterCSV change)

Updated by Jean-Philippe Lang over 15 years ago Actions #7

Works fine for me with Excel 2007. The same file with CRLF and what it gives in Excel 2007:

Display in Excel 2007

Updated by Etienne Massip over 15 years ago Actions #8

Gosh, right.

Excel 2003 renders the \r with a square character inside the cell :/

So that's basically an Excel version support question...

Updated by Etienne Massip over 15 years ago Actions #9

Jonas, could you post a sample of a non-working Excel 2007 workbook, please ?

Updated by Etienne Massip over 15 years ago Actions #10

  • Target version deleted (Candidate for next major release)

Updated by Rolf Stetter over 15 years ago Actions #11

Jean Philippe,
this is the result with Excel 2010 when opening your sample CSV:

Updated by Etienne Massip over 15 years ago Actions #12

Just raise the height of line 3.

Updated by Rolf Stetter over 15 years ago Actions #13

ups.. you are right!
So, I am very interested in getting your fix released..
Don't want to start patching.

Updated by Etienne Massip over 15 years ago Actions #14

This issue should probably be closed as a "Won't fix" since Excel >= 2007 opens Redmine exported CSV files containing EOLs just fine and supporting old Excel 2003 seems quite unnecessary now.

My patch simply replace CRLF inside column data with LF so it can be opened with Excel 2003.

Updated by Sven Müller about 15 years ago Actions #15

In german Wikipedia there is a hint:

Trennzeichen ist stillschweigend Semikolon, wenn die CSV Datei nach ANSI-Norm gespeichert ist

Trennzeichen ist stillschweigend Tabulator, wenn die CSV Datei in Unicode-Format gespeichert ist

The delimiter semicolon is expected when file is in ANSI.
The delimiter TAB is expected when file is in Unicode.

So is there a way to configure Redmine, to select eigther comma or semicolon for cvs files?

Updated by Sven Müller about 15 years ago Actions #16

I#ve tried to path one file. But in exported.csv are still comma

Any idea why?

Updated by Etienne Massip about 15 years ago Actions #17

Sven Müller wrote:

I#ve tried to path one file. But in exported.csv are still comma

Any idea why?

Did you read the issue description?

Updated by Ikon Ikon almost 14 years ago Actions #18

Hello guys,
still problems for me in Excel 2010. You need to do this:

*Use ";" to separate fields (column separator)
*Use CR+LF for line break out of text fields (row separator)
*Use LF for line break inside text fields (these are line breaks that will break cell text on multiple lines)

In that case, Excel will be happy. Tell me please the script to edit in order to fix the bug.

Thanks!

Updated by Sergey Prosin almost 14 years ago Actions #19

Hi, lkon.
To fix column separator you could edit your regional settings in folder \config\locales. Keep in mind the language you use in interface. Tha name of parameter is general_csv_separator. I'm not a redmine expert ;) so I'm not informed about solutions of line breaks, but may be you could find somethind in these files too.

Updated by Doan Phuoc almost 13 years ago Actions #20

Hi all,
I used redmine 2.3.3 and i can't fix it. May be help me.
I want export csv whith vietnamese language.
Thanks

Updated by Toshi MARUYAMA over 11 years ago Actions #21

  • Status changed from New to Closed
  • Resolution set to Wont fix

Etienne Massip wrote:

This issue should probably be closed as a "Won't fix" since Excel >= 2007 opens Redmine exported CSV files containing EOLs just fine and supporting old Excel 2003 seems quite unnecessary now.

I agree.

CSV character encoding in this issue is duplicate of #11116.

Actions

Also available in: PDF Atom