Hello everyone,
I’m trying to import a fixed-width .txt file into Stata, where the variables do not have separators. Here is the code I am using:
I’ve already successfully imported a similar database, so I thought this would work. Interestingly, importing only the first variable works:
The lengths and definitions of the variables are based on metadata, and I can't seem to identify the issue. Could anyone help diagnose the problem or suggest alternative methods for importing this type of .txt?
Thank you for your time and assistance!
I’m trying to import a fixed-width .txt file into Stata, where the variables do not have separators. Here is the code I am using:
Code:
clear infix /// codice_impresa 1-9 /// codice_fiscale 10-36 str27 /// ragione_sociale 37-236 str200 /// indirizzo 237-316 str80 /// cap 317-321 str5 /// using "C:\Users\chiara.tasselli\OneDrive - mef.gov.it\Istat ASIA\Registro_Asia_Imprese_Anno_2021_anagrafica\MICRODATI\20593.IST133.A.2021.1.txt"
Code:
clear infix /// codice_impresa 1-9 /// using "C:\Users\chiara.tasselli\OneDrive - mef.gov.it\Istat ASIA\Registro_Asia_Imprese_Anno_2021_anagrafica\MICRODATI\20593.IST133.A.2021.1.txt"
Thank you for your time and assistance!
Comment