Dear statalist,
I am working with a survey in which data comes in ASCII format (.DAT) and the dictionary (gives the position of the variables) of the file is in (.txt). What I am doing is creating a do.file that read this .DAT file using the command infix (see below and example)
I am wondering if there exist an easy way of doing this automatically, since the dataset is long, this can induce me to make a mistake when typing. I have see that the import option allow to do something like that, I mean, to read the file using the dictionary automatically. However, I tried but it seems that the file should be .raw and the dictionary should be .dct
This is the error I get if I try using the files I have .DAT for data and .txt for the dictionary.
Can anybody tell me if it is possible what I want to do, and then, how specifically tell Stata to read .DAT using the dictionary in .txt?
Many thanks in advanced for your help and time.
I am working with a survey in which data comes in ASCII format (.DAT) and the dictionary (gives the position of the variables) of the file is in (.txt). What I am doing is creating a do.file that read this .DAT file using the command infix (see below and example)
Code:
infix ORDINAL 1-10 AA_1993 12-23 AA_1994 25-36 AA_1995 38-49 AA_1996 51-62 AA_1997 64-75 AA_1998 77-88 AA_1999 90-101 AA_2000 103-114 AA_2001 116-127 AA_2002 129-140 AA_2003 142-153 AA_2004 155-166 AA_2005 168-179 AA_2006 181-192 AA_2007 194-205 AA_2008 207-218 AA_2009 220-231 AA_2010 233-244 AA_2011 246-257 AA_2012 259-270 AA_2013 272-283 AA_2014 285-296 AA_2015 298-309
Code:
infix using "C:\Users\dtojeiro\Dropbox\PhD\Second Paper ESEE_DATA\ESEE_2015\Datos actualizados\ESEE_Jul2017.txt", using("C > :\Users\dtojeiro\Dropbox\PhD\Second Paper ESEE_DATA\ESEE_2015\Datos actualizados\ESEE_Jul2017.DAT") Relaci�n de variables del fichero : ESEE_Jul2017 file does not contain dictionary r(613);
Can anybody tell me if it is possible what I want to do, and then, how specifically tell Stata to read .DAT using the dictionary in .txt?
Many thanks in advanced for your help and time.
Comment