fix csv conversion script

...more generalized accross different datasets