I have a task here that might be possible with VBA or VBScript. I did the first couple of steps with VBA but I am not sure how to proceed.
I am downloading annual reports from the SEC which I want to group in folders by their respective year and SIC code. I am doing this with the EDGAR package in R.
EDGAR has this filename convention -- Screenshot of file name format: https://drive.google.com/file/d/0B4GKNSEDe65tSjRUSTVfT2xOaTg/view?usp=sharing
I have a mapper of CIK code to SIC code. Screenshot of company ID to SIC mapper: https://drive.google.com/file/d/0B4GKNSEDe65tNnJobzk3Z0RQR1k/view?usp=sharing
Ultimately I would like to move all of these files into separate folders by SIC code.
I was able to create all the SIC code folders by adapting this code a bit: https://www.reddit.com/r/excel/comments/5uhp4i/create_multiple_folderssubfolders_based_on_data/
So I have a Folder "3825," "3350," and so forth.
Now I want to move all these files into these folders. I imagine the steps would be something like:
Thanks for taking a look. It is like a batch processing job, certainly new to me, so any suggestions welcome.
Best, George
I am downloading annual reports from the SEC which I want to group in folders by their respective year and SIC code. I am doing this with the EDGAR package in R.
EDGAR has this filename convention -- Screenshot of file name format: https://drive.google.com/file/d/0B4GKNSEDe65tSjRUSTVfT2xOaTg/view?usp=sharing
I have a mapper of CIK code to SIC code. Screenshot of company ID to SIC mapper: https://drive.google.com/file/d/0B4GKNSEDe65tNnJobzk3Z0RQR1k/view?usp=sharing
Ultimately I would like to move all of these files into separate folders by SIC code.
I was able to create all the SIC code folders by adapting this code a bit: https://www.reddit.com/r/excel/comments/5uhp4i/create_multiple_folderssubfolders_based_on_data/
So I have a Folder "3825," "3350," and so forth.
Now I want to move all these files into these folders. I imagine the steps would be something like:
- Extract the CIK code from file extension (essentially everything before the first "_")
- Find the corresponding SIC code from my master list
- Move that file into the corresponding folder
Thanks for taking a look. It is like a batch processing job, certainly new to me, so any suggestions welcome.
Best, George