Odkmeta: “column header type not found”

Hi all, I know this was partially addressed here however my error:

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

is not being solved by ensuring "type" is in fact the column header. Any ideas? Again, my survey file column header is already "type"

@Amanda_Berman, what is the exact Stata command that you're running for odkmeta? That could help us troubleshoot the issue.

odkmeta can issue this error message if the format of the survey file differs from what odkmeta expects. For example, the survey sheet of the XLSForm must be exported to its own CSV file, which must be comma-separated, not semicolon-separated. Could that be the issue here?

Hi Matthew,

The command is exactly as in the do file, with relax (999) on the end. I have the survey saved as CSV (saved the active sheet of the XLS file as CSV). I can upload the survey and choices XLS and CSV forms. I can't upload the data since it's sensitive.survey.csv (10.8 KB)
choices.csv (71.6 KB)

1 Like

@Amanda_Berman, it looks like survey.csv and choices.csv are encoded as Unicode (specifically UTF-8).

Stata 14+ supports Unicode. However, odkmeta was written to be compatible with Stata 11, and it does not currently support Unicode. We may add Unicode support in the future, but for now, I recommend exporting your CSV files as ASCII instead.

From a first glance, it looks like the one character in your XLSForm to watch out for is , the right single quote, which doesn't appear in all eight-bit extended ASCII encodings. As long as that character only appears in labels, the simplest solution is probably just to replace it with the straight single quote ' before exporting. The presence of the right single quote may be why the CSV was exported as Unicode in the first place.

I'll create a GitHub issue noting that we should consider adding Unicode support to odkmeta or at least better documentation.

1 Like

Awesome man, Keep this sprit.

Ok thanks, will try this!

1 Like

Hi, hope your are doing well,
any development so far as far as unicode(UTF-8) is concerned

HillaryM

We haven't added Unicode support to odkmeta yet, but it continues to be a feature we want to implement. Unicode support is a recent addition to Stata, having been introduced in Stata 14. In comparison, the current version of odkmeta is intended to be backward compatible up to Stata 11.

I think our next step for odkmeta will be to bump the required version to Stata 13 (two versions behind the latest version). That'll allow us to modernize parts of the do-file, for example, using import delimited instead of insheet. From there, I think we'll be well positioned to add Unicode support, but we're probably still a ways off from that time.

1 Like

Hi,
well then, is there any advice on how to go about this error
column header type not found
invalid type() suboption
invalid survey() option

thank you
Hillary

When you export the survey sheet of the form as .csv, I would check whether it contains non-ASCII characters. If it does, and those characters are in the label column, you should be able to resolve the error by replacing the characters with ASCII characters of your choice. For example, in the case above, had to be replaced with '. The best approach is likely to replace the characters in the XLSForm, then export to .csv again, rather than editing the exported survey .csv file.

Are you able to upload your form here? That'd be helpful in tracking down the specific issue.

great thanks,
i have managed to run it though my out put(.dta file) still has string observations, my hustle is now to edit the do file and code the strings with numeric values,

I'm glad you were able to generate and run the do-file! Are you seeing a Stata variable that is string that you expected to be numeric? If so, what was the type of the ODK field? Stata should automatically import fields like integer and decimal as numeric. The odkmeta do-file also value-labels select_one and select_multiple fields and formats date, time, and datetime fields, which makes all those types numeric in Stata.

A post was split to a new topic: Odkmeta: column header type not found. invalid type() suboption. invalid survey() option

choices.csv (14.6 KB) survey1.csv (1.8 KB)

These are my files, I still keep getting same error. Please help