Announcement

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

  • Display excel sheet's name when appending using xls2dta

    Hello,
    I have three excel workbooks and each of them contains at least 7 sheets. I have been able to append the files using xls2dta (xls2dta is from SSC). Say Workbook 1 is named as data containing sheets John Peter Joseph ... Workbook 2 is named as data2 containing sheets Sam Oliv .....The appended data display workbook names i.e. data data1 in the from generated variable but I would like to display the excel sheets for further follow-ups. Please help. My command is
    xls2dta, clear allsheets importopts(firstrow) generate(from) : append using ., force

  • #2
    The output of help xls2dta tells us that the generate() option can take one or two variable names as its arguments; if two variable names are given it will create the second variable name with the sheet name.

    Comment


    • #3
      William has answered the question. Thanks.

      I want to add that you should not (I dare say ever) use the force option. Instead, fix the underlying problem.

      Comment


      • #4
        William and Daniel,
        Thank you for your points. The first one worked. I am working on Daniel's point.

        Comment

        Working...
        X