Sign in with your CogSci, Facebook, Google, or Twitter account.
Or register to create a new account.
We'll use your information only for signing in to this forum.
I am unable to install Datamerger on my system. I am using Ubuntu 16.04 and i followed the steps mentioned. It says "unable to locate package datamerger". How do i install it?
The DataMerger is quite outdated by now. Below is a simple script that allows you to do more or less the same thing. The way it works:
I'll see if I can turn this into a simple extension to make it easier.
from datamatrix import io, DataMatrix
# This points toward the file pool if you run the script from within OpenSesame
# by selecting the script and clicking on the 'Run selected text' button.
# This will *not* work when running as an experiment, or as a standalone script.
DIRNAME = opensesame.experiment.pool_folder
dm = DataMatrix()
# Loop through all files in the source directory
for basename in os.listdir(DIRNAME):
# Skip files that aren't csv or start with merged (because that's the
# output file)
if not basename.endswith('.csv') or basename.startswith('merged'):
filedm = io.readtxt(os.path.join(DIRNAME, basename))
except Exception as e:
print('Failed to open %s (Exception: %s)' % (basename, e))
# Add a source column, and then concatenate the input file and the full
print('Read %s' % basename)
filedm.source = basename
dm <<= filedm
# Save to the source directory as both csv and xlsx
io.writetxt(dm, os.path.join(DIRNAME, 'merged.csv'))
io.writexlsx(dm, os.path.join(DIRNAME, 'merged.xlsx'))
There's much bigger issues in the world, I know. But I first have to take care of the world I know.