How to merge the ODK Briefcase exported file without loosing data

Hi,
How to MERGE an ODK Briefcase v1.16 exported files to one file (The files are generated based on a number of loops were used).

Hi, @Manne_Munikumar!

I think I need more details about your question in general. I didn't understand your reference to groups in the form in the context of a geojson export.

I can tell you now that merging JSON files requires some technical expertise, and it has to be done carefully to avoid breaking their structure. If you want to merge two geojson files exported by Briefcase - lets call them fileA and fileB - you should:

  • Copy all the elements from the collection at fileB.features from fileB
  • Paste them after the last element in the collection at fileA.features, ensuring there's a comma between the last from fileA and the first from fileB.

This merging method will blindly append all the elements, but there are other ways to merge elements, such as intersection, or substraction. These would require programming skills.

Hi,@ggalmazor,
Unable get the information,
While fetching the data from server the ODK Briefcase tool which is connected with server it generates more than one file depends on the loops were used. In this context how to merge those files into one file

Hi @Manne_Munikumar! I see that you have edited your original post and you have remove mentions to JSON files.

Does this mean that you're trying to merge all the exported CSV files into one file?

Hi @ggalmazor,
Yes we are trying to merge all the exported CSV files into one file

Hi, @Manne_Munikumar!

You could do this manually with a few submissions, but doing this at scale will require programming skills. Some things you need to consider:

  • All rows in all files have a KEY column that identifies that row.

  • All rows in group files have a PARENT_KEY column that can be used to link it to an upper level row (will be the same as the KEY column in the upper level file)

    As you can see, files can follow a tree-like structure, which makes your goal harder to achieve.

According to this, you could follow these KEY and PARENT_KEY values to copy rows from group files and append them into the main file as extra columns. You will have to duplicate information as you go, because one submission can have more than one answers in each repeat group.

You're trying to achieve something that can be super hard to do depending on your form's field structure. If you find yourself spending a lot of time and frustration starts to build up, I'd suggest you consider an alternative that doesn't require that you have all your data in a single file.