Actions

Exportation des résultats

From LimeSurvey Manual

Revision as of 20:37, 9 June 2013 by C schmitz (talk | contribs) (Text replace - "è" to "è")

{BOX(title="IMPORTANT")}Cette page n'est pas le contenu officiel de la traduction de limesurvey. Elle sera remplacé par la traduction de la page anglaise:{TRANSLATED(lang="en")}Exporting results{TRANSLATED} {BOX}

Copié-collé sauvage de l'article http://quanti.hypotheses.org/348/ le 14 juin 2009

Pour transférer les données de LimeSurvey vers votre logiciel de statistique préféré (R, SAS, SPSS, autre).

On top of the browse responses page several export options are listed, beginning with export to CSV/application.

Pourquoi faut-il transférer les réponses vers un autre logiciel ? La réponse est simple : LimeSurvey n’inclut pratiquement aucun outil d’analyse des données. Tout au plus, vous avez la possibilité d’obtenir les tris à plat des variables de l’enquête, et les graphiques correspondants :

  • 1. Dans la barre «Administration», cliquez sur l’icône : «Lister les questionnaires».
  • 2. Cliquez sur l’enquête dont vous voulez voir les résultats.
  • 3. Dans la barre «Questionnaire», cliquez sur : «Parcourir les réponses pour ce questionnaire».
  • 4. Dans la barre «Parcourir les réponses», cliquez sur : «Donner les statistiques de ces réponses».
  • 5. Cochez l’option «Visualiser le résumé de tous les champs disponibles».
  • 6. Cocher l’option «Afficher les graphiques».
  • 7. Cliquez sur le bouton «Visualisez les statistiques» en bas de la page.

SPSS Export

General

To export your response data to SPSS go to Responses & Statistics section and click the icon to export to SPSS.

Export and filter data

Vous obtenez ainsi, pour chaque question de votre enquête, un tableau statistique et un graphique présentant la distribution des réponses, en effectifs et en pourcentages, comme dans cet exemple tiré de l’enquête de Samuel Coavoux sur les joueurs de World of Warcraft :

Et si vous ne voulez pas tous les tris à plat, il vous suffit de ne pas cocher « Visualiser le résumé de tous les champs disponibles », mais seulement les questions qui vous intéressent. Cela dit, vous ne pourrez pas aller beaucoup plus loin. Par exemple, impossible apparemment de faire un tableau croisé…

After having downloaded these files you can open them using a raw text editor like notepad to take a look how the exported data looks like. The syntax file holds the commands that should be run to import the data. It is like a programming language inside SPSS. The data file contains a comma separated file with all data. If you just import this data as csv via a wizard you loose information about questions, labelsets etc. so we don't do that.

Import data in SPSS

Place the two files in the same folder on your drive (example: c:\data\survey_xxxx_SPSS_syntax_file.sps and c:\data\survey_xxxx_SPSS_data_file.dat)

We have two options now:

1. When using Windows use the explorer to browse to the folder used above. If SPSS is connected to the .sps file extension you can just open the file by double clicking it:

Now you can just choose Run->All from the opened window and after some time have your output dataset that you can save as a normal .sav file.

Pour réaliser des analyses, même très simples, de vos données, il n’y a donc qu’une seule solution : « exporter » les données de votre enquête, et les transférer dans le logiciel de statistique que vous avez l’habitude d’utiliser. L’avantage, c’est que LimeSurvey offre des solutions d’exportations du questionnaire et des réponses vers plusieurs logiciels d’analyse des données, que nous allons donc passer en revue ci-dessous, avant de voir comment faire pour les exporter vers d’autres logiciels : LimeSurvey propose des solutions pour R et pour SPSS, et je vous propose de mon côté, à la fin de cet articler, une macro Word pour transférer vers SAS votre enquête réalisée avec LimeSurvey.

Transférer les réponses vers R

Feel free to add more information if you have some!

LimeSurvey offre la possibilité d’exporter facilement les données vers le logiciel libre d’analyse des données R :

  • 1. Dans la barre «Administration», cliquez sur l’icône : «Lister les questionnaires».
  • 2. Cliquez sur l’enquête dont vous voulez exporter les résultats.
  • 3. Dans la barre «Questionnaire», cliquez sur : «Parcourir les réponses pour ce questionnaire».
  • 4. Dans la barre «Questionnaire», cliquez sur : «Exporter les résultats dans un fichier de données R».
  • 5. Cliquez sur «Exporter le fichier de syntaxe R», puis sur «Enregistrer», choisissez le dossier de destination, puis cliquez sur «Enregistrer».
  • 6. Cliquez sur «Exporter le fichier de données .CSV» , puis sur «Enregistrer», choisissez le dossier de destination, puis cliquez sur «Enregistrer».
  • 7. Ouvrez R et déterminez le dossier de travail en Tapez dans la fenêtre de commande de R:: «getwd()».
  • 8. Copiez le fichier de syntaxe et le fichier de données dans ce dossier.
  • 9. Tapez dans la fenêtre de commande de R: «source(”Surveydata_syntax.R”, encoding = “UTF-8″)». Attention: si vous avez changé le nom du fichier de syntaxe à l’étape 4 ci-dessus, il faut remplacer «Surveydata_syntax.R» par le nom que vous aviez choisi.

Ca y est, les données sont importées dans R : elles sont dans un objet nommé « data », et vous pouvez vous lancer dans leur analyse…

Et si vous débutez avec R, n’oubliez pas le guide « R pour les sociologues » rédigé par Julien Barnier et mis en ligne dans un précédent article de QUANTI :

http://quanti.hypotheses.org/217

Transférer les réponses vers SPSS

LimeSurvey offre aussi la possibilité d’exporter tout aussi facilement les données vers SPSS :

  • 1. Dans la barre «Administration», cliquez sur l’icône : «Lister les questionnaires».
  • 2. Cliquez sur l’enquête dont vous voulez exporter les résultats.
  • 3. Dans la barre «Questionnaire», cliquez sur : «Parcourir les réponses pour ce questionnaire».
  • 4. Dans la barre «Questionnaire», cliquez sur : «Exporter les résultats dans un fichier de commandes SPSS».
  • 5. Cliquez sur «Exporter le fichier de syntaxe SPSS», puis sur «Enregistrer», choisissez le dossier de destination, puis cliquez sur «Enregistrer».
  • 6. Cliquez sur «Exporter le fichier de données SPSS» , puis sur «Enregistrer», choisissez le dossier de destination, puis cliquez sur «Enregistrer».
  • 7. Ouvrez SPSS.
  • 8. Ouvrez le fichier de syntaxe dans SPSS en mode Unicode.
  • 9. Modifiez la quatrième ligne de ce fichier, qui commence par «/FILE=», pour indiquer le chemin exact du fichier de données tel que vous l’avez enregistré à l’étape 4 ci-dessus.
  • 10. Choisissez «Run/All» dans le menu pour lancer l’importation.

Transférer les réponses vers SAS

La possibilité d’exporter les réponses vers SAS n’a pas été prévu explicitement par les concepteurs de LimeSurvey, mais nous allons y arriver quand même sans trop de difficultés.

Remarque

Une première solution pourrait consister à utiliser la proc CONVERT de SAS, mais elle nécessite en entrée un fichier « portable » SPSS (avec l’extension .por), alors que ce n’est pas ce que nous donne LimeSurvey. On pourrait fabriquer un tel fichier en l’exportant depuis SPSS à la suite de l’étape précédente (voir ci-dessus, « Transférer les réponses vers SPSS »), mais cela nécessite d’avoir SPSS, et si vous avez SPSS, c’est que vous travaillez habituellement avec SPSS, alors pourquoi aller dans SAS ?… En plus, cette solution simple ne transfère par le dictionnaire des variables (intitulés des questions et des modalités de réponse), et il faut recourir à des solutions plus complexes, comme celle-ci, mais qui ne marche encore une fois qu’avec un fichier « portable » SPSS :

http://www.psych.yorku.ca/lab/sas/spss2sas.htm

Mais nous n’avons pas la possibilité de créer un fichier portable SPSS directement à partir de LimeSurvey, alors nous allons faire autrement…

Quand on veut exporter une enquête vers SPSS (voir ci-dessus : « Transférer une enquête vers SPSS »), LimeSurvey permet de créer deux fichiers : un fichier SPS contenant la structure de l’enquête, et un fichier DAT contenant les données. Ce sont ces deux fichiers que nous allons utiliser pour transférer les données vers SAS cette fois, à l’aide d’une petite macro Word que je viens de terminer, et que j’ai appelée lime2sas (prononcez « l’ail me toussasse » pour faire chic et angliche)…

Attention !

Pour réaliser le transfert des données de MODALISA vers SAS, j’ai utilisé les versions suivantes des différents logiciels :

- LimeSurvey version 1.80+

- Microsoft Word 2003 avec Microsoft Visual Basic 6.3

Je ne peux pas garantir que ça marche avec des versions plus anciennes de LimeSurvey ou plus récentes de Word, mais vous pouvez essayer, et dire ce que ça donne dans les commentaires de cet article…

Tout est donc dans un fichier Word qu’il suffit simplement d’ouvrir pour générer automatiquement le script SAS qui va effectuer en quelques secondes tout le travail de transfert des données et du dictionnaire des variables.

Pour en savoir plus :

Comment ça marche ? En réalité, ce fichier Word contient une « macro » écrite en Visual Basic pour Word, qui s’exécute automatiquement à l’ouverture du fichier : cette macro génère un script SAS qui va faire tout le travail à votre place : la « macro » va ouvrir le fichier d’exportation de la structure au format SPS que vous avez créé précédemment, et le transformer en un script SAS qui créera et appliquera les formats et les labels, puis elle va compléter ce script SAS pour importer les données à partir du fichier d’exportation des données au format DAT.

Pour commencer il faut donc télécharger le fichier Word « lime2sas.doc » qui se trouve à l’adresse suivante :

http://quanti.hypotheses.org/files/2009/03/lime2sas.doc

Ensuite, procédez de la façon suivante :

1. Dans la barre «Administration», cliquez sur l’icône : «Lister les questionnaires».

2. Cliquez sur l’enquête dont vous voulez exporter les résultats.

3. Dans la barre «Questionnaire», cliquez sur : «Parcourir les réponses pour ce questionnaire».

4. Dans la barre «Questionnaire», cliquez sur : «Exporter les résultats dans un fichier de commandes SPSS».

5. Cliquez sur «Exporter le fichier de syntaxe SPSS», puis sur «Enregistrer», choisissez le dossier de destination, puis cliquez sur «Enregistrer».

6. Cliquez sur «Exporter le fichier de données SPSS» , puis sur «Enregistrer», choisissez le dossier de destination, puis cliquez sur «Enregistrer».

7. Ouvrez le fichier « lime2sas.doc ».

8. Si un « avertissement de sécurité » concernant les macros s’affiche, cliquez sur « Activez les macros ».

9. Si une fenêtre s’affiche avec le message « Les macros de ce projet sont désactivées… », cliquez sur « OK », puis dans le menu « Outils », sélectionnez « Options », et dans l’onglet « Sécurité », cliquez sur « Sécurité des macros » et sélectionnez le niveau de sécurité faible ou moyen. Cliquez deux fois sur « OK », quittez Word et recommencez à l’étape 1 ci-dessus.

10. Cliquez sur « OK », puis sélectionnez le fichier de syntaxe SPS exporté depuis LimeSurvey à l’étape 5.

11. Quand le transfert de la structure est terminé, cliquez sur « OK », puis sélectionnez le fichier DAT des données exporté depuis LimeSurvey.

12. Quand le transfert des données est terminé, cliquez sur « OK ».

13. La « macro » contenue dans le fichier « lime2sas.doc » a généré un programme SAS intitulé « lime2sas.sas », qui est enregistré dans le répertoire où se trouvait votre fichier DAT de données exporté depuis LimeSurvey. Cliquez avec le bouton droit de la souris sur le fichier « modalisa2sas.sas », et sélectionnez « Submit » ; ou bien sélectionnez « Open with SAS » pour ouvrir le script dans une fenêtre « Editor » de SAS, puis exécutez-le.

14. Le script a créé une librairie appelée « lime », dans laquelle se trouve le fichier de données, appelé « data », et les formats des variables.

Attention !

Toutes les variables de la base de données obtenue dans SAS après le transfert sont des variables alphanumériques, qui contiennent donc des caractères. Cette solution est généralement préconisée pour réduire la taille des fichiers de données et augmenter les vitesses de traitement. Si vous souhaitez transformer certaines variables en variables numériques, en fonction des analyses que vous voulez en faire, il vous suffit d’écrire un script SAS qui effectue cette transformation. Par exemple, le script ci-dessous copie la table « old » dans une table « new » en transformant la variable alphanumérique « TAILLEalpha » en la variable numérique « TAILLEnum ».

data new ;

set old ;

TAILLEnum = input(TAILLEalpha,best.);

run ;

Voilà, normalement tout s’est bien passé (dites-moi si ce n’est pas le cas…), et vous avez désormais dans SAS votre enquête réalisée avec LimeSurvey, à votre plus grand bonheur ! Bien sûr, je vous ai encore fait le coup, pas très élégant, de la macro Word… C’est promis, la prochaine fois, j’essaie de faire une macro SAS, ce sera mieux, mais en attendant cette solution fera l’affaire…

Transférer les réponses vers d’autres logiciels

Si votre logiciel de statistique préféré n’est ni R, ni SPSS, ni SAS, mais un autre logiciel (Spad, Stata…), il vous reste pour l’instant la solution générique, qui consiste à exporter les données de votre enquête au format Ascii ou au format CSV, puis à les importer dans votre logiciel (tous les logiciels offrent la possibilité d’importer des données au moins sous l’un ou l’autre de ces formats). Et bien sûr, vous pouvez, en vous inspirant par exemple de ce qui précède, fabriquer une solution spécifique pour votre logiciel : dans ce cas, n’hésitez pas à la signaler dans les commentaires ! En attendant, voici comment exporter votre enquête au format Ascii depuis LimeSurvey :

  • 1. Dans LimeSurvey, dans la barre «Administration», cliquez sur l’icône : «Lister les questionnaires».
  • 2. Cliquez sur l’enquête dont vous voulez exporter les résultats.
  • 3. Dans la barre «Questionnaire», cliquez sur : «Parcourir les réponses pour ce questionnaire».
  • 4. Dans la barre «Questionnaire», cliquez sur : «Exporter les résultats dans une application».
  • 5. Choisissez les options que vous souhaitez. Si vous souhaitez un fichier Ascii, cochez le format «Microsoft Word», sinon cochez «Fichier CSV».
  • 6. Cliquez sur «Exporter les données».
  • 7. Cliquez sur «Enregistrer», choisissez le répertoire de destination, puis cliquez sur «Enregistrer».

Vous pouvez maintenant, normalement, importer le fichier obtenu dans votre logiciel de statistique…

Liens utiles

Macros pour Word 2003

http://office.microsoft.com/fr-fr/word/CH060840311036.aspx

LimeSurvey

http://www.limesurvey.org/index.php?lang=fr

R

http://www.r-project.org

SPSS

http://www.spss.com/fr

spss2sas

http://www.psych.yorku.ca/lab/sas/spss2sas.htm

SAS

http://www.sas.com/offices/europe/france

Once you've begun collecting responses, there may be occasions where you need to be able to directly edit and modify large quantities of data from your responses table, where a spreadsheet tool may be more useful.

VVExport and VVImport (the "VV" stands for vertical verification) allow you to export your responses table into a .csv file. So long as the general structure of the file remains intact, you can then edit values within it, and the import the file again into your responses table using the "VVImport" feature.

Things you should be aware of:

  • If you want to import responses using "VVImport" make sure to check whether the responses should be added to the existing responses or all responses should be overwritten.
  • If you are trying to import responses from a diffrent yet identical (e.g. identical questions/answers from another survey) make sure you are using the correct vv file and that the first two lines of the .csv-file are correct.
  • If you import a survey to your LimeSurvey installation the SID will (if possible) not change. The group id and question id however might change. So you might have to adjust the first to heading lines to match the new group id/question id. See Adjusting vv file headings

Exporting a VV survey file

File:LimesurveyExportVVen.jpg

When you choose to export responses using VVExport you will be given the option to choose which survey to be exported, whether you want to export all responses or complete responses only or incomplete responses only. The file extension allows you to choose which extension the exported file will have. For easy use .csv should be chosen.

A 'vv survey file' allows you to import the responses to a survey when the question/answer combinations have changed. Effectively this allows you to add or remove questions in an active survey.

Clicking on "Export a VV survey file" will then produce a tab delimited file that can be opened by Excel or similar style spreadsheet program. The first two rows of the spreadsheet are the column labels. The first row is a "human readable" column heading that details the name of the question/answer field. The second row is the internal PHP/database column name for that response.

You should not modify the first two rows of this spreadsheet if you want to be able to "import" the data back into LimeSurvey at a later point.

Editing a VV survey file

When a vv file has been successfully exported you can use a spreadsheet tool like Microsoft Excel or alternatives to open and edit the file. If you have to choose the column seperator use "Tabulator". If you are using mutated vowels (like ä, ö or ü in the german language) make sure you use "UTF-8" as used character set.

If you are using Microsoft Excel to edit the exported vv file, you should know that excel destroys the original data structure of the file. This causes an error when you try to re-import the edited vv file.

But there is a workaround which allows you to edit the file with excel and import it without problems, as one of our users found out (see "Importing a VV survey file")

As mentioned before the first two rows of the vv file are headers so you should not change them. There are different use cases for importing a vv file so we will differentiate between adding new responses to a survey and overwriting all responses of the survey.

example (structure of a vv file):

Response ID    Date submitted    Last page    Start language    please vote from 1 to 6 (1 - super, 6 - worst)

id    submitdate    lastpage    startlanguage    token        46492X40X1991

183    09.11.11 11:44    3    de        4

184    09.11.11 11:53    3    de        2

190    09.11.11 11:44    3    de        1

Adding new responses to the existing responses of a survey

If you want to add new responses to the survey you can delete every row past row two (the both headers should not be deleted) and add the new responses using one response for each row. You can add the responses by entering them manually or copy/paste the reponses from e.g. another vv file (be carefull to add the responses only and not the header.)

Example

Step 1: Open file

Response ID    Date submitted    Last page    Start language    please vote from 1 to 6 (1 - super, 6 - worst)

id    submitdate    lastpage    startlanguage    token        46492X40X1991

183    09.11.11 11:44    3    de        4

184    09.11.11 11:53    3    de        2

190    09.11.11 11:44    3    de        1

Step 2: Delete old answers

Response ID    Date submitted    Last page    Start language    please vote from 1 to 6 (1 - super, 6 - worst)

id    submitdate    lastpage    startlanguage    token        46492X40X1991

Step 3: Add new answers

Response ID    Date submitted    Last page    Start language    please vote from 1 to 6 (1 - super, 6 - worst)

id    submitdate    lastpage    startlanguage    token        46492X40X1991

17    10.11.11 12:44    3    de        4

18    24.11.11 14:53    3    de        2

You can then import the survey, make sure not to override the existing responses (see "Importing a VV survey file").

Overwriting all responses of the survey

If you want to overwrite all responses of the survey you can just add the new responses to the end of the file. As mentoind in "Adding new responses to the existing responses of a survey" you can either enter them manually or copy/paste them from another vv file.

example

Step 1: Open file

Response ID    Date submitted    Last page    Start language    please vote from 1 to 6 (1 - super, 6 - worst)

id    submitdate    lastpage    startlanguage    token        46492X40X1991

183    09.11.11 11:44    3    de        4

184    09.11.11 11:53    3    de        2

190    09.11.11 11:44    3    de        1

Step 2: Add new answers (at the end of the document)

Response ID    Date submitted    Last page    Start language    please vote from 1 to 6 (1 - super, 6 - worst)

id    submitdate    lastpage    startlanguage    token        46492X40X1991

183    09.11.11 11:44    3    de        4

184    09.11.11 11:53    3    de        2

190    09.11.11 11:44    3    de        1

17    10.11.11 12:44    3    de        4

18    24.11.11 14:53    3    de        2

You can then import the survey, make sure to override the existing responses (see "Importing a VV survey file").

Adjusting vv file headings

When importing a survey it might happen that the survey id stays the same while the group and question ids change. In order to import the survey results you have to adjust the headings of the vv file. How to import a new survey and the survey results will be explained below.

example

Step 1: Import the new survey

Step 2: Activate the new survey

Step 3: Export the "empty" results of the new survey as vv file

Step 4: Open the "empty" vv file (new SGQA: 46492X45X3269)

Response ID    Date submitted    Last page    Start language    please vote from 1 to 6 (1 - super, 6 - worst)

id    submitdate    lastpage    startlanguage    token        46492X45X3269

Step 5: Copy the first two lines/rows from the "empty" vv file

Step 6: Open the exported vv file from the old LimeSurvey installation (old SGQA: 46492X40X1991)

Response ID    Date submitted    Last page    Start language    please vote from 1 to 6 (1 - super, 6 - worst)

id    submitdate    lastpage    startlanguage    token        46492X40X1991

183    09.11.11 11:44    3    de        4

184    09.11.11 11:53    3    de        2

190    09.11.11 11:44    3    de        1

Step 7: Paste the new headings (copied two lines/rows) into the first two lines/rows of the old vv export file (now the SGQA should be 46492X45X3269)

Response ID    Date submitted    Last page    Start language    please vote from 1 to 6 (1 - super, 6 - worst)

id    submitdate    lastpage    startlanguage    token        46492X45X3269

183    09.11.11 11:44    3    de        4

184    09.11.11 11:53    3    de        2

190    09.11.11 11:44    3    de        1

You can now import the vv file and the headings are correct.

Importing a VV survey file

File:LimeSurveyImportVVen.jpg

As long as the first two lines are intact, you can then import the data in your vv survey file back into an active LimeSurvey survey.

If you used Microsoft Excel to edit the exported vv file, the data structure of this file may be corrupted, so limesurvey is not able to import the edited file. You can try the following workaround to get the import working without an error:

  • Open your exported vv file in excel and do your changes (I guess you already did that)
  • Save it as tab-separated text file (It creates a new file with the extension .txt)
  • Do another "clean" vv export from limesurvey
  • Open this new exported vv file with a texteditor like notepad or something else (I used textwrangler on mac, it works fine with that)
  • Press CTRL + A to mark all of the content and delete it
  • Open the excel edited vv file (the tab separated .txt file) with a texteditor and press CTRL + A to mark all of the content
  • Press CTRL + C to copy the content and paste it into the new (now empty) vv file
  • Press STRG + S to save the file as it is (as .csv)
  • Now try to import this file

Then, from the browse screen, choose the "Import a VV Survey file" icon.

The "Import a VV Survey File" screen needs you to choose the "vvexport" file you are importing. If you choose to "Exclude Record IDs" the records will be imported and brand new Record ID's will be generated for them (use this option for the use case "Adding new responses to the existing responses of a survey"). If you un-check this box, then the original record id's will be imported (use this option for the use case "Overwriting all responses of the survey").

There are a range of options you can choose that tell LimeSurvey how to deal with double or multiple entries.

  • Report an error (and skip the new record).
  • Renumber the new record
  • Replace the existing record (uses this for the use case "Overwriting all responses of the survey")

Other export options

Export a single response

If you want to export an individual response, you can do it in 3 ways:

1. Login to limesurvey admin backend, choose your survey, goto "Edit survey settings" -> "Notification and data management" and make sure you receive basic email notifications.

Every time someone has completed a survey, you will receive an email with a link: "Click the following link to see the individual response"

This will take you to a page with a button above the data saying "Export this response"

2. Login to limesurvey admin backend, choose your survey and "Browse responses for this survey". Click on "Display responses" and the id number you want to export in the left column. Then you can click on "Export this survey" above the data.

3. Login to limesurvey admin backend, choose your survey and "Export results to application". In the last field above "Export data" you can choose which entry you want to export.

Match Responses From Different Surveys (longitudinal survey)

If you want to track survey responses for particular individuals over time, Limesurvey can help you do that. A possible use case is to track group responses before and after the group takes a particular seminar.

The steps to implementing this are as follows:

1. Create the survey

2. Make sure the survey is non-anonymous and uses tokens. To create a non-anonymous survey:

a) Click on the edit survey button:

b) Then under the Notification & data management tab select "No" for Anonymous answers:

3. Activate the survey.

When you activate the survey, click on the "switch to closed-access mode" button to create the token table:

4. Populate the tokens table with whatever method you wish (follow the instructions found at the Tokens page ).

5. Export the survey results and make sure you include the token information.

To export click browse results...

...and then export:

Remember to choose one or more elements from the token table to associate with the survey responses:

6. When you run the survey again, which can easily be done by copying the survey and tokens table using export/import, just repeat the steps, and make sure the same query is used to build the csv token import file.

Problems & Solutions

Excel

Modifying responses in Excel prior to Import

In order to make multiple changes to responses, you may choose to Export and open a file in Excel. Make changes to the data (other than the top lines) and then save as a .txt file. If you save as .csv, Excel uses comma-delimits which will not import into LimeSurvey. By saving as a .txt file, Excel saves as a tab-delimited file which imports back into LimeSurvey.

Edit .csv with Excel

In general we do not recommend to use Excel to edit the exported .csv files because Excel does some changes to the internal data structure which results in a failing import. If you nevertheless want to use Excel you have to set the seperator for Excel to a comma in System Control (Windows Systems):

System Control|Region- Languageoptions|Regional Settings, customize...|Tab Numbers|Digit grouping symbol| replace ; with ,

Workaround to edit .csv files with Excel

Using Excel for editing questions can prevent you from being able to re-import them. But editing is the way to go if you have more than 5 or so options or ranking options, want to use Excel capabilities like sorting, etc.

This is a partial workaround that seems to work in 1.82-essentially, only use Excel on the part of the file that is the data:

  • Export a question similar to what you would like to reuse as .csv file
  • Open the CSV file in a rawtext editor
  • Copy the part that has the answers to Excel, and parse it with Text to Columns or equivalent.
  • Use the talent of Excel to allow pasting text in columns to paste in 20, 50, 100 answers, as you wish
  • Save the file as Excel CSV, which will likely have no quotes.
  • Open this file in the editor, and Select All, Copy
  • Go back to the file you opened in 2)
  • Paste over the answers there
  • Save AS, with a different name, maybe one that you can remember for reuse
  • Import this file.

Excel - export limited to 255 columns

Due to limitations in Excel (versions lower and equal to 2003), LS can export only 255 columns at the same time. Microsoft has proposed a workaround as a VB macro.

Although newer spreadsheets (Excel >= 2007, OpenOffice) can display more than 255 columns, the internal module used by LimeSurvey still can't export more than 255 columns.

Two workarounds are however possible, use one of the following solutions:

  • Either export to CSV and import in your spreadsheet
  • Or use multiple exports (selecting at most 250 columns at a time), then merge the exported results

Excel/.csv - export fails

If you are unable to export your data to excel or into a .csv file please try to clear your browser cache and cookies.

CSV

CSV defaults to 255 columns

When exporting large surveys the GUI by default limits the export to the first 255 columns. To work around this, simpyl mark all data sets for export.

SPSS export

General steps

To import the LimeSurvey response data please use the following steps:

  1. Click on the 'Export to SPSS' icon.
  2. From the select boxes select which responses you want to export and your SPSS version.
  3. Download both files, the .sps (SPSS syntax command file) and .dat file (data file)
  4. Open the .sps file with SPSS by opening SPSS, then select 'Choose another type of file' and select the downloaded .sps file.
  5. Now an editor opens inside SPS where you can edit the commands in that file. Look for the line that starts with '/FILE=...'
  6. Edit that line and adjust the path so it points to your .dat file. Example: Your *.dat file is in c:\temp so set this line to  /FILE='c:\temp\survey_(xxxx)_SPSS_data_file.dat'
  7. Now select all commands inside the editor by pressing CTRL-A.
  8. From the SPSS menu select Run/All.
  9. Be patient, it will take some time to import all data and labels. Check the status bar for the progress.
  10. Done!

Possible error messages in SPSS

ERROR. command name:Get Data

If you receive the error message ERROR. command name:Get Data. 2267 Unexpected Token missing. please edit the forth line of your syntax file so it points to the absolute path of the data file like

C:\spss\Data\limesurvey\SPSS\survey_35276_SPSS_data_file.dat

Error: "Text value unmappable in the current server locale"

This error can happen if you try to open an exported syntax file in SPSS 16. The solution is to force SPSS to interpret the syntax file as unicode.

Open SPSS. Go to Edit > Options > Character encoding for data and syntax. Change the option to "unicode".

LimeSurvey data can now be exported to SPSS 16 without any problem.

Define the scale to use for your variable by setting a question attribute

It is possible to override the default scale used for a variable by setting the question attribute #scale_export|scale_export to the appropriate value.

VV Export/Import

VV - Problems with vv import

If you have difficulties importing a vv file, try a Tab-delimited file and it should work fine.

Other problems and solutions

Copying responses into a different survey (using tokens)

  1. Create new survey, add a dummy response, export the response file, open in Excel. This creates the format for the new import file.
  2. Export the responses from the old survey, including tokens, open in Excel.
  3. Use this data to create an Excel worksheet for the standard token file import (eg. Firstname, Lastname, Token, Email address, Email status (OK), Language (En). Save as .csv and import tokens to the new survey in LimeSurvey.
  4. In Excel, copy the response fields from the old survey responses that you want in the new survey (including token) into the appropriate Excel column of the new survey format.
  5. Save as .txt file.
  6. Use VVImport to import the new data into the new survey.
  7. Possible import errors include date format - some system date fields do not allow a NULL value, some do. If the date looks okay but gives an error, use the Excel cell format "2009-12-01!