Odkmeta: column header type not found. invalid type() suboption. invalid survey() option

Hello,

I am having an issue described in a previous post, getting the following error:

column header type not found
invalid type() suboption
invalid survey() option

The command I am using is just:

odkmeta using odkmetado, csv("$data\baseline_180909.csv") survey("$survey\survey.csv") choices("$survey\choices.csv") replace

I was not sure if my .csv files had any non-ASCII characters, so I tried stripping them (not sure if that was successful). I am attaching my survey.csv (77.4 KB) and choices.csv (44.1 KB) files for your reference. Is it still the encoding or could the issue be something else? Appreciate your help - I am really not sure what my next steps are.

Hi @yuliab! When you get a chance, please introduce yourself here. Thanks for uploading survey.csv and choices.csv, as that definitely aids debugging.

When I run odkmeta for survey.csv and choices.csv, I actually see a slightly different error message:

column header label not found
invalid label() suboption
invalid survey() option
r(111);

This error message is issued because survey.csv does not contain a column named label. However, you can specify a different column using suboption label():

odkmeta using odkmetado, ///
	csv("$data/baseline_180909.csv") ///
	survey("$survey/survey.csv", label(label:english)) ///
	choices("$survey/choices.csv", label(label:english)) ///
	replace

See the help file for more details about this suboption.

Also, am I right that you added the first column of survey.csv and that it just contains the row number? If that's the case, you should be able to (and will likely need to) remove that column before specifying survey.csv to odkmeta.

When I take these steps, I'm able to run odkmeta without error. Given that type is the first column once the row-number column is removed, I think that means that there is no issue with Unicode characters.

Hope that helps!

I also have the following messages after running odkmeta:

column header label not found
invalid label() suboption
invalid survey() option

Could you suggest the possible solutions?

Ko Zaw
University of Public Health
Yangon

Hi @kokozaw! The most common reason for this error message is an encoding issue. See the discussion here and here and let us know if that helps.

Dear Matthew White

Thank you for your response. I will try to solve the problem as you advised.

Regards

Ko Ko Zaw

Dear Team,

So, 8 months later, I am using ODK collect and testing to export my data from ONA server and use odkmeta to generate the Stata dofile; but I kept getting that exact error message;

column header name not found
invalid name() suboption
invalid choices() option

I read the discussions here and tried some of the recommendations but so far I have not fixed it. I am using stata 15 in case that has something to do with it. Could someone please help me fix this issue?

Thanks all for the help!
Hiwot

Welcome @hiwot_mekonen! When you get a chance, please introduce yourself here. Doing so helps build community!

odkmeta creates a do-file that imports submission data that matches the ODK Briefcase export CSV format. I'm not sure whether data exports that you prepare from within Ona match this format, though I seem to recall that they don't. However, you should be able to connect ODK Briefcase to Ona, then export your data using ODK Briefcase; you can then use the odkmeta do-file to import the resulting data.

However, first you need to use odkmeta to create the do-file, and it seems that you are running into an issue in this step. I've used odkmeta with Stata 15, so I don't think that's the cause. (Stata also has excellent version control, such that odkmeta should continue working in new versions of Stata.)

What is the full odkmeta command that you are running? Are you able to share your XLSForm?

Hello,

I am Jado, working on a HAPIN Trial project.
I am facing with the same issue.
I wanted to share with you an issue I am facing while trying to work with odkmeta.
In fact, while running the odkmeta dofile, I am getting the following error message:

column header type not found
invalid type() suboption
invalid survey() option

Here are csv files that I am using:

I would appreciate if you can help.

Thanks,
Jado