psychopy.org | Reference | Downloads | Github

Recover CSV files from experiment with "database" saving format

URL of experiment:

Description of the problem:
We have set up our workflow to import and analyze the csv files produced by online experiments. Unfortunately, one of our lab members inadvertently set the saving mode of our experiment to “database” last week. About a dozen data files were saved in this mode, meaning we can see .log but not .csv files for them in the GitLab repo. Is there a way to recover these .csv files or reproduce them from the .log files? I’m not familiar with the workings/reasoning behind “database” mode, but I’d also be interested in suggestions on how to avoid this mistake in the future (e.g., an experimenter-level setting that disables database mode for all my experiments).

I discovered that when I downloaded the data from the Pavlovia page, the folder it produced contained a .csv file starting with “Database_AllParticipants”. This file appears to be the csv data files of all the subjects since the switch to “database mode” stacked on top of one another. I wrote a Python script to separate the data from each participant into individual csv files with the same subject_experiment_datetime.csv naming convention, and I placed those files back in the gitlab repo’s data folder. The columns are in a different order now, but I think this should do the job.

If anyone has a similar issue, feel free to use the script, which I’ve posted to GitHub here: https://github.com/djangraw/PsychoPyParadigms/blob/master/OnlineExperiments/RecoverPavloviaCsvsFromDatabase.py.

1 Like