Please Help Me: Using of odkmeta command

Hi!
I am William Dormechele. I have used ODK to carry out data collection. I am using the odkmeta command in Stata 16 and facing some issues.

I use the following command:
odkmeta using odkdo, csv(data.csv) survey(survey.csv) choices(choices.csv)

where I have extracted the survey and choices sheets from the main tool and converted them into CSV (Comma Delimited)

I get the following error:
column header label not found
invalid label() suboption
invalid survey() option

I am attaching the tool mhs data.xlsx (861.7 KB) . Is there a problem with the csv conversion and ASCII characters? I couldn't wrap my head around that.

Hi @William20! It looks like you've uploaded your data, but when generating the do-file, odkmeta only uses the survey and choices sheets of the XLSForm, not the data itself. Are you able to upload the XLSForm here?

Also, how are you downloading your data? odkmeta is designed for data that matches the ODK Briefcase export CSV format. You can use ODK Briefcase to download data in that format. The CSV download in ODK Central also matches that format.

Thank you very much, Matthew_White
Please I downloaded the data from "google drive"

Please kindly see the XLSForm attached.MHS Survey Screen.xlsx (49.6 KB)

Your form contains a few non-ASCII characters:

, for example, to…/To
, for example, Don’t
, for example, people‘s

You can try replacing or removing these characters (for example, replacing the curly quotes with the straight quote '). If you do so in the original XLSForm, then re-export the survey and choices sheets as CSV files, then odkmeta should be able to read the CSV files.

That said, if your data was sent directly from ODK Collect to Google Sheets (if you are not using a server like ODK Central or ODK Aggregate), then the data you download likely won't match the format that odkmeta expects. (I believe that data in Google Sheets uses a different format from the ODK Briefcase export CSV format.) That means that the do-file that odkmeta generates likely won't work for importing your data to Stata. You could try on your own to modify the do-file. However, your form doesn't contain a repeat group, and it mostly contains select_one, text, and integer fields, so it may be just as easy to manually write your own do-file to import the data.

I am facing an issue of group names which are attached to the variable name from do file generated by odkmeta. then how to remove those group name. because when I am trying to run the do file. STATA reports that variable not exist. I think it can be better to add an option that removes those group name because even you download data with group names, they are not similar to what generated by odkmeta.