Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Misaligned data when exported in CSV #609

Closed
anonymous-piwik-user opened this Issue · 4 comments

3 participants

Anonymous Piwik user Anthon Pang Matthieu Aubry
Anonymous Piwik user

I am downloading data from piwik using API and in csv format. However, at certain places, e.g. row 42, 56, 66 in attached file, the data is shifted to undesired columns stopping me from processing. Keywords: csv

Anonymous Piwik user

Attachment: CSV File [20piwik-report-export.csv](http://issues.piwik.org/attachments/609/20piwik-report-export.csv)

Anonymous Piwik user

Sorry, my bad. The data set contains commas, reason enough for misalignment.

Anthon Pang
Collaborator

This is one of the better write ups on the CSV pseudo-standard:

  • http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm

Proposed changes to /core/DataTable/Renderer/Csv.php:

  • escape double quotes (" becomes "")
  • wrap any field with double quotes if it contains comma or double quotes

Proposed test cases added to /tests/core/DataTable/Renderer.test.php:

  • field with no double quotes or commas
  • field with comma
  • field with double quotes
  • field with commas and double quotes
Matthieu Aubry
Owner

(In 1008) – fixed #609 Misaligned data when exported in CSV thanks vipsoft for your pre-analysis and suggestions

Anonymous Piwik user anonymous-piwik-user added this to the RobotRock milestone
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.