Not sure what's going on, column headers are separated by semicolons and rows seem to have a ridiculous amount of white space. please see screenshot.

Comments

robpowell created an issue. See original summary.

robpowell’s picture

Title: CSV headers separated by semicolons » CSV export headers separated by semicolons
graber’s picture

Status: Active » Needs work

For the whitespace, see https://www.drupal.org/node/2896348#comment-12181404.

As to the delimeter problem - looks like different versions of Excel have different default csv reading rules.

A good solution would be to add a setting to choose a delimeter in admin settings section.

I know csv can be delimeted by comma and semicolon, any other options required?

robpowell’s picture

@graber I think they are less popular but tab and pipe ('|').

graber’s picture

Status: Needs work » Needs review
StatusFileSize
new5.5 KB

Added a config for selecting from semicolon, comma or pipe.

  • Graber committed 6d87800 on 8.x-2.x
    Issue #2896347 by Graber, robpowell: CSV export headers separated by...
graber’s picture

Status: Needs review » Fixed

1.5 month without a review so I assume all is fine. Committing.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

dmezquia’s picture

StatusFileSize
new778.25 KB

Hi, i have the same issues but with the exported csv file, it shows whitespaces, i applied the patch and it did not work.

graber’s picture

Status: Closed (fixed) » Active

We may have to strip whitespaces.

graber’s picture

After some time I got back to the project and reproduced the issue. The answer is there: https://stackoverflow.com/questions/4238433/php-how-to-create-a-newline-... - we need to use double quotes for new line replacement in PHP strtr().

  • Graber committed ddc46fb on 8.x-2.x
    Issue #2896347 by Graber, robpowell, dmezquia: CSV export headers...
graber’s picture

Status: Active » Needs review

  • Graber committed 26754b2 on 7.x-1.x
    Issue #2896347 by Graber, robpowell, dmezquia: CSV export headers...
graber’s picture

One more thing: when twig debug is on, a lot of new lines are generated. Those will now be successfully converted to spaces so best practice for testing the output would be turning the twig debug off.

graber’s picture

Status: Needs review » Fixed

Right. I guess this is no longer an issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.