worldbank / iefieldkit

Stata commands designed for Impact Evaluations field work. These are tools that are used during/after a survey in the field for data quality monitoring.
MIT License
39 stars 18 forks source link

iecodebook: option saveas does not include file format #249

Closed luizaandrade closed 1 year ago

luizaandrade commented 1 year ago

when running the run files on Linux, the files created by the following two lines are not in .dta format:

iecodebook export `auto' using "${codebook}/auto_export.xlsx", replace saveas("auto_data")
iecodebook export `auto' using "${codebook}/auto_export.xlsx", replace saveas("${codebook}/auto_new")

The issue seems to come from replacing the local savedta with the user input in saveas without checking for the file format or adding .dta to the string.

Currently the run file for iecodebook does not run on Linux.

bbdaniels commented 1 year ago

Do you get an error or do the files not get created? The run-file also was not using the full path so they were being put in the wrong folder as well, although that was separate from the fact that Stata will not correctly recognize them without the extension. Proposed fix in daa151a29e560ec5e3cfd22d1191b2a179cdddbf