I have 3 CSV files (each has stock holdings in 3 dif accounts) I download each day, exactly the same format (data in columns A:W), filenames:
- account_1.csv
- account_2.csv
- account_3.csv
I concatenate them all into a single CSV with a simple single-line .bat batch file with this line:
The problem is that each CSV file contains only raw data, and no indicator as to WHICH account the data comes from so I end up with a single concatenated file of raw data in columns A:W, but no indication as to which rows came from each of the 3 initial CSV files.
So is there anything I can add to the batch file that will make the single concatenated CSV file populate column Y (the first empty column) with the file name of the CSV the rows came from?
(I know there's probably VBA I could write that will run import-from-text functions that can populate column Y with the filename, but I'd prefer doing it via batch file...)
- account_1.csv
- account_2.csv
- account_3.csv
I concatenate them all into a single CSV with a simple single-line .bat batch file with this line:
copy C:\Users\user1\Downloads\account*.csv C:\Users\user1\Downloads\concat_file.csv
The problem is that each CSV file contains only raw data, and no indicator as to WHICH account the data comes from so I end up with a single concatenated file of raw data in columns A:W, but no indication as to which rows came from each of the 3 initial CSV files.
So is there anything I can add to the batch file that will make the single concatenated CSV file populate column Y (the first empty column) with the file name of the CSV the rows came from?
(I know there's probably VBA I could write that will run import-from-text functions that can populate column Y with the filename, but I'd prefer doing it via batch file...)