View Issue Details

IDProjectCategoryView StatusLast Update
16647Bug reportsCentral participant databasepublic2020-09-23 11:47
Reporterphitho Assigned Togabrieljenik  
PrioritynormalSeverityminor 
Status confirmedResolutionfixed 
Product Version3.23.3 
Summary16647: Can't select seperator for CPDB export - export doesn't recognise text
Description

I exported the CPDC, but I wasn't able to select a separator. As a default, comma was selected. However, this messes up the variable, since some of the categories, in my case, contain a comma, but answer categories are not put in brackets.

TagsNo tags attached.
Complete LimeSurvey version number (& build) Version 3.23.3+200909
I will donate to the project if issue is resolvedNo
Browser
Database & DB-VersionI'm not the admin
Server OS (if known)
Webserver software & version (if known)
PHP VersionI'm not the admin

Relationships

related to 16672 assignedgabrieljenik Bug reports Can't select seperator for CPDB export - export doesn't recognise text 
child of 16683 assignedgabrieljenik Feature requests Allow select seperator for CPDB export 

Activities

cdorin

cdorin

2020-09-15 15:17

manager   ~59816

I am not sure if I understand the issue - could you please provide us a .csv file to test it? It does not sound like a LS problem but more of a third-party spreadsheet software issue.

DenisChenu

DenisChenu

2020-09-15 15:28

developer   ~59817

Seems clear : we surely don't use https://www.php.net/manual/en/function.fputcsv.php

@phitho ; can you confirm the way to reproduce

  1. Add firstname "jean,jacque'
  2. Add name "name'
    Export CS
    Loo at file :
    name,jean,jacque
phitho

phitho

2020-09-15 16:23

reporter   ~59819

@denischenu: Yes, that's the problem. What would be needed is to either put the different answers in quotation marks to mark them as text or to be able to select a separator. Thanks!

DenisChenu

DenisChenu

2020-09-15 16:24

developer   ~59820

@cdorin : clear enough ?
@phitho : please, if you can add a screenshot of data, and a partial exported bad csv file.

cdorin

cdorin

2020-09-15 16:31

manager   ~59821

I see - will mark it as confirmed and see the easiest solution to implement it

phitho

phitho

2020-09-15 16:32

reporter   ~59822

Attached you find a sample file.

central_1600180280.csv (711 bytes)   
participant_id,firstname,lastname,email,language,blacklisted,owner_uid,date,birthyear,gender,state,inhabtitant,education1,education2,municipality,city,btw2017recall,eu2019recall,education3,edu_school,edu_job,vote_intention_local,school
a2d4242b-0e86-4815-a28d-8385cfd3bd09,,,qqq@qqq.qq,en,N,69,,1991,Männlich,Nordrhein-Westfalen,,,,,Dortmund, krfr. Stadt,Sonstiges,Die Linke,,Abitur, EOS - Erweiterte Oberschule mit Abschluss 12. Klasse, Fachhochschulreife,Sonstiges,Die Linke,
cf40ae7a-b323-4ee2-976d-238b4bbbcb5e,,,qqq@qqq.qq,en,N,69,,1957,Weiblich,Nordrhein-Westfalen,,,,,Bielefeld, krfr. Stadt,Grüne,Grüne,,Abgeschlossenes Studium an Hoch- oder Fachhochschule, Universität, Polytechnikum,,Grüne,
central_1600180280.csv (711 bytes)   
cdorin

cdorin

2020-09-15 16:40

manager   ~59825

So, I would choose to have a CSV field separator option in the pop up displayed on the screen when you confirm which columns are being selected. Separators to be used: Comma, Semicolon, Tab .

phitho

phitho

2020-09-15 16:42

reporter   ~59828

That should work! It could be problematic if someone imports open end answers where users may have entered e.g. tab in their answers, but for standard questions, that should work.

DenisChenu

DenisChenu

2020-09-15 16:47

developer   ~59832

Last edited: 2020-09-15 16:48

View 2 revisions

@cdorin : NO ! please , real csv : https://www.php.net/manual/en/function.fputcsv.php

enclosure.
This allow
abcde,123,"tot,titi","toto,\"titi"

It's the way PHP do with fputcsv, why create bad code when PHP have a great function ?

DenisChenu

DenisChenu

2020-09-15 16:49

developer   ~59833

You can still allow update separator (dor some broken tools)

But : still use enclosure AND escape_char (default is OK with good tools and bad tools)

cdorin

cdorin

2020-09-15 16:52

manager   ~59834

Yep, sounds cleaner. I will create a ticket in that regard

cdorin

cdorin

2020-09-15 16:52

manager   ~59835

@gabrieljenik, could you please push the fix to LS4 as well when there is time?

gabrieljenik

gabrieljenik

2020-09-21 22:47

developer   ~59914

Created a ticket for the enhancement: 16683
Created a ticket for LS4: 16672

DenisChenu

DenisChenu

2020-09-22 08:48

developer   ~59916

@gabrieljenik great :+1:

gabrieljenik

gabrieljenik

2020-09-22 16:23

developer   ~59927

Last edited: 2020-09-22 16:24

View 2 revisions

PR: https://github.com/LimeSurvey/LimeSurvey/pull/1599
Used 'fputcsv' in CPDBExport() with default args

gabrieljenik

gabrieljenik

2020-09-23 11:47

developer   ~59939

Fix committed to 3.x-LTS branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=30506

Related Changesets

LimeSurvey: 3.x-LTS 5f58ca88

2020-09-22 16:19:59

gabrieljenik

Details Diff
Fixed issue 16647: Can't select seperator for CPDB export - export doesn't recognise text

Used 'fputcsv' in CPDBExport() with default args.
Affected Issues
16647
mod - application/helpers/export_helper.php Diff File

LimeSurvey: 3.x-LTS 540de77e

2020-09-23 11:47:08

ollehar


Committer: GitHub Details Diff
Fixed issue 16647: Can't select seperator for CPDB export - export doesn't recognise text

Dev: Merge pull request #1599 from gabrieljenik/bug/16647--Can't-select-seperator-for-CPDB-export---export-doesnt-recognise-text
Affected Issues
16647
mod - application/helpers/export_helper.php Diff File

Issue History

Date Modified Username Field Change
2020-09-09 10:55 phitho New Issue
2020-09-15 15:17 cdorin Status new => feedback
2020-09-15 15:17 cdorin Note Added: 59816
2020-09-15 15:28 DenisChenu Note Added: 59817
2020-09-15 16:23 phitho Note Added: 59819
2020-09-15 16:23 phitho Status feedback => new
2020-09-15 16:24 DenisChenu Note Added: 59820
2020-09-15 16:31 cdorin Note Added: 59821
2020-09-15 16:32 phitho Note Added: 59822
2020-09-15 16:32 phitho File Added: central_1600180280.csv
2020-09-15 16:40 cdorin Note Added: 59825
2020-09-15 16:42 phitho Note Added: 59828
2020-09-15 16:47 DenisChenu Note Added: 59832
2020-09-15 16:48 DenisChenu Note Edited: 59832 View Revisions
2020-09-15 16:49 DenisChenu Note Added: 59833
2020-09-15 16:52 cdorin Note Added: 59834
2020-09-15 16:52 cdorin Note Added: 59835
2020-09-15 16:53 cdorin Assigned To => gabrieljenik
2020-09-15 16:53 cdorin Priority none => normal
2020-09-15 16:53 cdorin Status new => confirmed
2020-09-16 17:38 gabrieljenik Issue cloned: 16672
2020-09-16 17:38 gabrieljenik Relationship added related to 16672
2020-09-21 22:46 gabrieljenik Issue cloned: 16683
2020-09-21 22:46 gabrieljenik Relationship added child of 16683
2020-09-21 22:47 gabrieljenik Note Added: 59914
2020-09-22 08:48 DenisChenu Note Added: 59916
2020-09-22 16:23 gabrieljenik Note Added: 59927
2020-09-22 16:24 gabrieljenik Note Edited: 59927 View Revisions
2020-09-23 11:47 ollehar Changeset attached => LimeSurvey 3.x-LTS 540de77e
2020-09-23 11:47 gabrieljenik Changeset attached => LimeSurvey 3.x-LTS 5f58ca88
2020-09-23 11:47 gabrieljenik Note Added: 59939
2020-09-23 11:47 gabrieljenik Resolution open => fixed