Problems with "infix" in a .dat file

#1
How to input an observation with more than 1025 characters?

Hi everybody,

I'm trying to read a .dat file into Stata, and I'm having a problem:

my dataset contains, generally, observations of families in lines. Each one of these families has, of course, a few individuals. I'm reading this information with the "infix" comand, creating a variable, say, v20_1 for individual #1 until v20_30 for individual #30. The most of the families has less than 10 persons. Those families fit in one single line, and the command ok for these cases - i just drop the variables v20_11 to v20_30. The problem is when there are more than 10 individuals (more than 1025 columns, the limit of the notepad): they don't fit in a single line, and "infix" reads the second line as a new family. Was I clear enough? Can anyone help me?

Thanks!
 
Last edited:

bukharin

RoboStataRaptor
#2
From what you've described the problem is that your input file has a limited line length due to using Notepad. So the first step would be to save it using a better text editor that doesn't artificially limit the line length. Apparently Wordpad can do this, although I would probably go for a proper text editor like Notepad++.
 
#3
From what you've described the problem is that your input file has a limited line length due to using Notepad. So the first step would be to save it using a better text editor that doesn't artificially limit the line length. Apparently Wordpad can do this, although I would probably go for a proper text editor like Notepad++.
Thanks for your help, bukharin!

Actually, I've found out that the problem is not really the text editor, but this extension ".dat". I've solved my problem simply by converting my data files to .txt, using the Windows' Notepad - it still breaks the lines at the 1025th column, but Stata can read those lines who exceed this limit as single ones.