Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • changing formats of datasets within Stata

    Hi,

    I am looking for a an easy command to be able to quickly convert the format of datasets within Stata. Specifically, I would like to be able to convert files between the following formats: dta, csv, xlsx. Does anyone know of a command that works well to do that? I dont want to do it by simply copy pasting in data. Any help would be great. Thanks!

  • #2
    You can interchange data between .xlsx and .dta by using the -import excel- and -export excel- commands. You can intercahnge between .dta and .csv by using -import delimited- and -export delimited-. You cannot directly interchange between .xlsx and .csv in Stata--you can do that by first importing into Stata and then exporting into the other format. But remember that .xlsx and .csv formats are much less highly structured than the .dta format, so that transfering information from .xlsx to .csv via Stata (or the other way around) is potentially problematic, as the .dta format can be a severely Procrustean bed for .xlsx or .csv files that fully exploit the unstructured nature of those formats.

    The commands mentioned in the first paragraph are all well documented in the PDF user manuals that come with your Stata installation. Each has a fair number of options that you will need to become familiar with to use them effectively, so invest some time in reading the manual sections before trying to use them.

    Comment


    • #3
      Thanks for your response Clyde!

      Comment

      Working...
      X