Project

General

Profile

Actions

Defect #19092

closed

CSV Export and general csv separator

Added by Alberto Martinelli almost 10 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
No feedback
Affected version:

Description

Hi everyone, this report is for redmine 2.4.3.stable (I've not found in any mention of this problem in changelog for 2.4.x, 2.5.x or 2.6.x)

For CSV Export I've found a bug when users uses redmine general_csv_separator in subject or description.

Steps to reproduce problem (I assume that general_csv_separator used is ;)
1) open a new issue
2) as subject use test;1 and description test;1
3) save issue
4) export as csv
5) open csv with excel, you don't see inserted test or description

To solve this problem, I suggest together try to follow best practices with CSV (starting for example from Wikipedia ).
Following Wikipedia links I've found this (see 6):

  6.  Fields containing line breaks (CRLF), double quotes, and commas
       should be enclosed in double-quotes.  For example:

       "aaa","b CRLF
       bb","ccc" CRLF
       zzz,yyy,xxx

so i propose to change redmine csv export when a field there is csv separator, adding double-quotes, what do you think?

Note: I know that I can change my csv separator settings in locale, for example using another separator as | or $, but this is not solving this issue, because users can enter anything in any field.

Note2: could please admins add a new category for issues related to CSV export?

Thank you


Files

excel2013-ja.png (6.32 KB) excel2013-ja.png Toshi MARUYAMA, 2015-02-12 13:42
Actions #1

Updated by Toshi MARUYAMA almost 10 years ago

I cannot reproduce.

$ hg parent --template='{branch}:{svnrev}\n'
2.6-stable:13884
$ ruby --version
ruby 1.8.7 (2014-01-28 patchlevel 376) [x86_64-linux]

Japanese separator is "," as same English.

CSV file:

#,Tracker,Status,Priority,Subject,Assignee,Updated,Description
7,Bug,New,Normal,Korean Translation,"",02/12/2015 09:23 PM,"new line
new line
new line" 

Excel 2013:

Actions #2

Updated by Toshi MARUYAMA almost 10 years ago

$ hg parent --template='{branch}:{svnrev}\n'
2.6-stable:13984
$ ruby --version
ruby 1.8.7 (2014-01-28 patchlevel 376) [x86_64-linux]
$ ruby script/rails console
Loading development environment (Rails 3.2.21)
1.8.7-head :001 > csv_string = FCSV.generate(:col_sep => ';') do |csv|
1.8.7-head :002 >      csv << ["ddd\neeee", "fffff"]
1.8.7-head :003?>   end
 => "\"ddd\neeee\";fffff\n" 
Actions #3

Updated by Toshi MARUYAMA almost 10 years ago

$ ruby --version
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]
$ irb
1.9.3-p551 :001 > require 'csv'
 => true
1.9.3-p551 :002 > csv_string = CSV.generate(:col_sep => ';') do |csv|
1.9.3-p551 :003 >      csv << ["ddd\neeee", "fffff"]
1.9.3-p551 :004?>   end
 => "\"ddd\neeee\";fffff\n" 
Actions #4

Updated by Jan Niggemann (redmine.org team member) about 9 years ago

  • Status changed from Needs feedback to Closed
  • Resolution set to Invalid
Actions #5

Updated by Jan Niggemann (redmine.org team member) about 9 years ago

  • Resolution changed from Invalid to No feedback
Actions

Also available in: Atom PDF