>> Home >> Resources & support >> FAQs >> Converting other format files into Stata dataset files

How can I convert other packages' files to Stata format data files?

Title   Converting other format files into Stata dataset files
Author Shannon Driver, StataCorp

The most popular spreadsheet format is the Microsoft Excel® worksheet. You can use the import excel command to read .xls and .xlsx files into Stata.

If your data are stored as a SAS XPORT file, you can use the import sasxport command to read this file into Stata.

Most spreadsheet and statistical software packages are able to export data as ASCII text files containing fixed-format, free-format, comma-delimited, or tab-delimited data. If your package has this feature, you should be able to export the data, and then read the data into Stata using the infile (fixed format or free format), infix, or insheet command, depending on the file format. For information about infiling data and the method you should use, see [D] infiling.

Another way to convert your data to Stata format is to register your data as an ODBC source and then use Stata's odbc commands to read the data directly into Stata.





The Stata Blog: Not Elsewhere Classified Find us on Facebook Follow us on Twitter LinkedIn Google+ YouTube
© Copyright 1996–2017 StataCorp LLC   •   Terms of use   •   Privacy   •   Contact us