I am having trouble importing an Excel file. I have a number variable (used as a reference number so every single digit is equally important) in Excel which shows up perfectly in the sheet but gets truncated when using import.
Please see the attached image to see the made-up Excel file used as an example.
The exact command I use to import, using Stata 12.0, is:
import excel "Classeur1.xlsx", sheet("Feuil1") firstrow allstring
The result being:
list
+-----------
| Variable
|-----------|
1. | 3.215e+09
2. | 65151
3. | n/a
4. | 999
5. |
|-----------
The result does not change (probably because of the "n/a") if I drop the allstring option from import.
This was easily fixed by first exporting to CSV from Excel and then using insheet on the resulting file. Is there any way to do this directly from Stata?
Thank you,
Marco
Please see the attached image to see the made-up Excel file used as an example.
The exact command I use to import, using Stata 12.0, is:
import excel "Classeur1.xlsx", sheet("Feuil1") firstrow allstring
The result being:
list
+-----------
| Variable
|-----------|
1. | 3.215e+09
2. | 65151
3. | n/a
4. | 999
5. |
|-----------
The result does not change (probably because of the "n/a") if I drop the allstring option from import.
This was easily fixed by first exporting to CSV from Excel and then using insheet on the resulting file. Is there any way to do this directly from Stata?
Thank you,
Marco
Comment