Dear Stata users,
I am trying to import .txt data into Stata. The main problem is that my data is not delimited. Using space as a delimiter also does not work because in some variables there are two words or more (ex.: line 6 of my data example). Here is an example of my data:
Code_du_département Libellé_de_département Code_Insee_de_la_commune Libellé_de_la_commune Population_de_la_commune Nom_de_lélu Prénom_de_lélu Code_sexe Date_de_naissance
01 AIN 001 L'Abergement-Clémenciat 780 BOULON Daniel M 4/3/1951
01 AIN 002 L'Abergement-de-Varey 234 GONNAND Robert M 28/2/1929
01 AIN 004 Ambérieu-en-Bugey 13839 EXPOSITO Josiane F 3/3/1943
01 AIN 005 Ambérieux-en-Dombes 1600 PERNET Pierre M 29/7/1961
02 AISNE 774 Vendelles 109 PRUVOST Stéphane M 28/6/1976
05 HAUTES ALPES 071 Lardier-et-Valença 304 COSTORIER Rémi M 11/10/1959
Could anyone advice me how should I code, to be able to import my data? I am using Stata 16.
I am trying to import .txt data into Stata. The main problem is that my data is not delimited. Using space as a delimiter also does not work because in some variables there are two words or more (ex.: line 6 of my data example). Here is an example of my data:
Code_du_département Libellé_de_département Code_Insee_de_la_commune Libellé_de_la_commune Population_de_la_commune Nom_de_lélu Prénom_de_lélu Code_sexe Date_de_naissance
01 AIN 001 L'Abergement-Clémenciat 780 BOULON Daniel M 4/3/1951
01 AIN 002 L'Abergement-de-Varey 234 GONNAND Robert M 28/2/1929
01 AIN 004 Ambérieu-en-Bugey 13839 EXPOSITO Josiane F 3/3/1943
01 AIN 005 Ambérieux-en-Dombes 1600 PERNET Pierre M 29/7/1961
02 AISNE 774 Vendelles 109 PRUVOST Stéphane M 28/6/1976
05 HAUTES ALPES 071 Lardier-et-Valença 304 COSTORIER Rémi M 11/10/1959
Could anyone advice me how should I code, to be able to import my data? I am using Stata 16.
Comment