Announcement

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

  • Converting multiple xls file to txt files

    Dear Stata users,
    1) can you share me a code for converting multiple xls files to txt?
    2) When I import txt file I do have the option of importing the first raw as a variable name or not as a result all of my variables will be v1 v2 v3---which is easy for renaming. however when I import the xls file either i have the option of importing the first raw as a variable, which i do not want, or it will automatically name the variables as A B C D E--------.Is there a way of avoiding this A B C ....and instead import it like txt?

    Best

    Johannes

  • #2
    If I understand your question correctly, you are looking for a way to import an Excel spreadsheet, but have the variables named v1, v2, etc. instead of A, B, C, ... etc. This will do it:

    Code:
    import excel using my_spreadsheet.xlsx, clear
    rename * v#, renumber

    Comment


    • #3
      Dear Clyde Schechter

      Yes , that is what I want

      Thanks


      Comment

      Working...
      X