Hi
I want to transform a set of around 1,500 Excel files (all in a similar format as the ones attached) into a single Stata file. The Stata file will have
(1) the first column with the "Company Name" (in Cell B1 in each Excel file),
(2) the second column with "Company Ticker" (in the Excel file name before the "_"),
(3) the third column with "Date" (in the Excel file name after the "_").
(4) some columns (one for each nationality) with the percentage of investors per nationality (the percentage of each investor is in column C and the nationality of that investor is in column K). These columns should be the sum of investors' percentage for each nationality.
my data in excel files are something like this
and my desired output would be like this
I want to transform a set of around 1,500 Excel files (all in a similar format as the ones attached) into a single Stata file. The Stata file will have
(1) the first column with the "Company Name" (in Cell B1 in each Excel file),
(2) the second column with "Company Ticker" (in the Excel file name before the "_"),
(3) the third column with "Date" (in the Excel file name after the "_").
(4) some columns (one for each nationality) with the percentage of investors per nationality (the percentage of each investor is in column C and the nationality of that investor is in column K). These columns should be the sum of investors' percentage for each nationality.
my data in excel files are something like this
Company | Energizer Holdings Inc | ||||||||||
RIC | ENR | ||||||||||
Download Date | 25-Feb-2024 | ||||||||||
Shareholders Report | |||||||||||
# | Investor Name | % Outstanding | Position (M) | Position Change (M) | Turnover | Investor Type | Investor Sub-Type | Equity Assets ($, M) | Investment Style | City | Country/Region |
31-May-2016 | 31-May-2016 | 31-May-2016 | 31-May-2016 | ||||||||
1 | JP Morgan Asset Management | 8.21% | 5.08 | 0 | Low | Investment Managers | Investment Advisor | 6,58,717.11 | GARP | New York | United States |
2 | The Vanguard Group, Inc. | 7.29% | 4.51 | 0 | Low | Investment Managers | Investment Advisor/Hedge Fund | 65,91,312.17 | Index | Malvern | United States |
3 | The London Company of Virginia, LLC | 7.22% | 4.46 | 0 | Low | Investment Managers | Investment Advisor | 18,623.15 | Core Value | Richmond | United States |
4 | BlackRock Institutional Trust Company, N.A. | 6.74% | 4.17 | 0 | Low | Investment Managers | Investment Advisor | 35,20,976.98 | Index | San Francisco | United States |
5 | Gabelli Funds, LLC | 3.70% | 2.29 | 0 | Low | Investment Managers | Investment Advisor/Hedge Fund | 24,307.34 | Core Value | Rye | United States |
6 | Ceredex Value Advisors LLC | 3.40% | 2.10 | 0 | Moderate | Investment Managers | Investment Advisor | 5,759.02 | Deep Value | Orlando | United States |
7 | Westwood Management Corp. (Texas) | 3.17% | 1.96 | 0 | Low | Investment Managers | Investment Advisor | 12,055.33 | Core Value | Dallas | United States |
8 | State Street Global Advisors (US) | 2.82% | 1.74 | 0 | Low | Investment Managers | Investment Advisor/Hedge Fund | 21,58,203.83 | Index | Boston | United States |
9 | Janus Henderson Investors | 2.73% | 1.69 | 0 | Low | Investment Managers | Investment Advisor/Hedge Fund | 2,07,004.05 | Core Growth | London | United Kingdom |
Company Name | Date | Country name 1 | Country name 2 | …. |
First File Name before _ | First File Name after _ | Total of coloumn C of country name 1 in first excel file | Total of coloumn C of country name 2 in first excel file | ….. |
Second File Name before _ | second File Name after _ | Total of coloumn C of country name 1 in second excel file | Total of coloumn C of country name 2 in second excel file | …. |
… | …. | … | … | … |
Comment