The easiest way to get your .csv (comma-separated values) text files into Stata is this: insheet using myfile.csv, comma names This assumes that your .csv file is well-behaved: names are on the first row, and any commas really are field separators. This is sometimes not the case. Recently I got a set of .csv files [...]
Archives for posts tagged ‘regular expression’
Looking through files
Friday, 5 December 2008
You can have Stata scan a do-file instead of executing it, just as it would any text file. This is helpful if you have elaborate projects that cover entire directory trees full of little do-files that do different things for different subsets of the project if given conditions are met, and skip them otherwise. You [...]
Encode uses and pitfalls
Friday, 5 September 2008
You won't always receive data saved in the most efficient format and there is no relief in sight. Bandwidth and hard drive sizes are growing unabated and making this only more likely, not less. It's common, for example, that data sets have string variables with a limited range of values. Suppose you have a file [...]