Accueil arrow Support arrow Forums
LimeSurvey Forums
Welcome, Guest
Please Login or Register.    Lost Password?
csv export: how to handle embedded quotes (1 viewing) (1) Guest
Go to bottom Favoured: 0
TOPIC: csv export: how to handle embedded quotes
#17006
Blue Echidna (User)
Fresh Lemon
Posts: 17
graphgraph
User Offline Click here to see the profile of this user
csv export: how to handle embedded quotes 5 Months, 1 Week ago Karma: 0  
Dear all,

When exporting in a CSV format Lime appears to put everything between quote s (" This keeps commas (,) in your questions from causing problems, but single and double quotes then cause problems when I parse the resulting CSV. I get multiple columns from the header for a question that has quotes in it. The data columns then get out of alignment.

Is there a way to cause lime to escape the quotes when exporting a question to CSV? i.e. something like

"Do you think grades should be "weighted" so that an 'A' receives 5 points", "next question"

tired of counting commas,
DAvid

p.s. Quatro Pro is the only editor we've found that can read in CSV exports more than 255 columns. (other than a raw viewer like notepad++ where you could count all 355 commas to see if they line up.)
 
Logged Logged  
  The administrator has disabled public write access.
#17052
Mazi (Moderator)
Moderator Lime
Posts: 3503
graph
User Offline Click here to see the profile of this user
Re:csv export: how to handle embedded quotes 5 Months ago Karma: 28  
Which version do you use?

How do you try to parse data and what for? CSV export was mainly introduced to analyse data in Excel.

I think the new Excel version supports 65xxx columns!?
 
Logged Logged  
 
Best regards,
Mazi
______________________
Need help? I can: set up Limesurvey for you / create your survey / implement additional features / design your template / offer premium support -> Contact.
  The administrator has disabled public write access.
#17131
Blue Echidna (User)
Fresh Lemon
Posts: 17
graphgraph
User Offline Click here to see the profile of this user
Re:csv export: how to handle embedded quotes 5 Months ago Karma: 0  
Dear Mazi,
Thanks for your reply.

I am using Python to read the csv data. I have 5 utilities I've developed, written in Python, that utilize the CSV module included with Python to read surveys and score them. We currently have 10, live surveys, almost all of which are wider than 255 questions. The Python code generates an intermediate summary file which I then use to create graphical tables. We used to used Excel 2003 and VBA to score our PHPSurveyor surveys, but it is so much easier in Python.

I am using Lime 1.70+ (4831)

According to some old comments in my code, which I wrote about a month ago, when I was experimenting with the CSV reader in Python, somehow I was getting escaped quotes, i.e. " (If I told Python CSV my escape char was it turned them into \" Is there a setting on a survey that would affect this? (I don't know which survey I was testing with at that time, but I definitely have one now that doesn't escape the quotes.

I did upgrade Lime at one point (to 4831) to get the SPSS export to work. I'd have to dig thru some old files to see if the Python comments predated that upgrade.

The exact question, as it shows up in Notepad when exported from Lime as a CSV: (quotes are from Lime)

"Do you think Grade Point Averages should be "weighted" for students taking harder, advanced placement or honors courses? (For example, an 'A' in an advanced placement course is worth 5 points, instead of the usual four.)"
 
Logged Logged  
  The administrator has disabled public write access.
#17152
Mazi (Moderator)
Moderator Lime
Posts: 3503
graph
User Offline Click here to see the profile of this user
Re:csv export: how to handle embedded quotes 5 Months ago Karma: 28  
There have been some csv bugs which are solved now. Please upgrade to the latest release. More information:
- Download latest release
- Upgrade instructions
 
Logged Logged  
 
Best regards,
Mazi
______________________
Need help? I can: set up Limesurvey for you / create your survey / implement additional features / design your template / offer premium support -> Contact.
  The administrator has disabled public write access.
#21330
konmanos (User)
Expert Lime
Posts: 96
graphgraph
User Offline Click here to see the profile of this user
Re:csv export: how to handle embedded quotes 1 Month, 2 Weeks ago Karma: 0  
I am also experiencing the same issue, with the "" quotes around all of the responses in the CSV file, as well as CR/LF.

I have found - and this is not acceptable - that if you open the CSV file using Excel and then save it as CSV all of the quotes and the CR/LF is removed.

What can I do - so that I do not have to open and save the exported file to prevent this from happening?
 
Logged Logged  
 
LS Version 1.72 (5737)
  The administrator has disabled public write access.
#21331
Mazi (Moderator)
Moderator Lime
Posts: 3503
graph
User Offline Click here to see the profile of this user
Re:csv export: how to handle embedded quotes 1 Month, 2 Weeks ago Karma: 28  
konmanos wrote:
I am also experiencing the same issue, with the "" quotes around all of the responses in the CSV file, as well as CR/LF.
If you think there still is a bug at 1.72 export please open a ticket at the bugtracker and give as much information as possible and also attach your survey. You can mark your ticket "private" so that only the developers will be able to take a look at it.

Afterwards please post the link to the bugtracker so we can follow the progress.
 
Logged Logged  
 
Best regards,
Mazi
______________________
Need help? I can: set up Limesurvey for you / create your survey / implement additional features / design your template / offer premium support -> Contact.
  The administrator has disabled public write access.
#21336
konmanos (User)
Expert Lime
Posts: 96
graphgraph
User Offline Click here to see the profile of this user
Re:csv export: how to handle embedded quotes 1 Month, 2 Weeks ago Karma: 0  
Bug has been raised - bug report - 02670
 
Logged Logged  
 
LS Version 1.72 (5737)
  The administrator has disabled public write access.
Go to top