Briefcase's export to csv changes hyphens in group names to underscore

When briefcase saves repeat groups' content into separate csv files, it names that csv file with the repeat groups name. But all hyphens in repeat group name are replaced with underscore. For instance: for repeat-group-name in mysurvey briefcase generates csv file mysurvey-repeat_group_name.csv

For programming purpose ideally I'd prefare mysurvey-repeat-group-name. Is there any way to keep original repeat name in generated csv file's name or should I try to check and fix it with my own code?

Hi @Odil,

I do n't think there is a straight forward way to replace the underscores with hyphens, I think you should try in your own way.

Thanks,
Imran

I was thinking about this topic, because I don't think that ODK Central exhibits this behavior for the submission CSV download: hyphens are not replaced with underscores. We try to have this output from Central match Briefcase as closely as possible, so I think we should either change this behavior in Briefcase or have Central match Briefcase.

As far as I can tell, I think it'd be safe to make this change in Briefcase:

  • This behavior isn't documented in the description of the Briefcase export CSV format.
  • A hyphen is used in the Briefcase filename to separate the form and the name of the repeat group. But it is the unqualified name of the repeat group that is used: if the repeat group is nested in a group or another repeat group, the name of the parent group is not included in the filename. So I don't think there's any risk of duplicate filenames by making this change.

I don't think I've encountered this substitution before, so I also don't account for it in odkmeta, which imports Briefcase-format data into Stata.

@LN, what do you think the best approach would be?

1 Like