I need to import several Excel files. Each Excel file has three variables, item, price and quantity.
Here are some examples.
.
food.xlsx
.
gas.xlsx
.
I want to import several Excel files and make one Stata dataset like this:
.
Price and Quantity are located in one column in Excel, but I want to transpose the column into the row in Stata for several Excel files.
Please help me solve this. Thanks!
Here are some examples.
.
food.xlsx
A | B | C |
Food | Price | 10 |
Food | Quantity | 100 |
gas.xlsx
A | B | C |
Gas | Price | 3 |
Gas | Quantity | 50 |
I want to import several Excel files and make one Stata dataset like this:
Item | Price | Quantity |
Food | 10 | 100 |
Gas | 3 | 50 |
Water | 7 | 25 |
... | ... | ... |
Price and Quantity are located in one column in Excel, but I want to transpose the column into the row in Stata for several Excel files.
Please help me solve this. Thanks!
Comment