Howdy all,
I'm struggling to correctly import an xlsx file into stata. The file has variable labels in the first row of the file and variable names in the second row.
If I just use the "firstrow" option when importing, it uses the xlsx labels as stata variable names and uses the xlsx variable names as the first instance of the data.
If I instead use "firstrow cellrange(A2)", the xlsx variable names are correctly used as stata variable names, but now the xlsx labels are lost in the ether.
How may I correctly import the file such that I can correctly use the second row as variable names without losing the variable labels in the first row? I would just switch the first and second rows manually, but there are dozens of files that I need to do this with and I've been asked to not touch the data outside of stata. Thanks all for your time
I'm struggling to correctly import an xlsx file into stata. The file has variable labels in the first row of the file and variable names in the second row.
If I just use the "firstrow" option when importing, it uses the xlsx labels as stata variable names and uses the xlsx variable names as the first instance of the data.
If I instead use "firstrow cellrange(A2)", the xlsx variable names are correctly used as stata variable names, but now the xlsx labels are lost in the ether.
How may I correctly import the file such that I can correctly use the second row as variable names without losing the variable labels in the first row? I would just switch the first and second rows manually, but there are dozens of files that I need to do this with and I've been asked to not touch the data outside of stata. Thanks all for your time
Comment