Hello,
- I have the following folder/file structure:
MP1
CT
CTfile1.csv
CTfile2.csv
CV
CVfile1.csv
CVfile2.csv
FT
FTfile1.csv
FTfile2.csv
...etc - it keeps on going for more subfolders.
- Every subfolder has 2 different .csv files.
- Every file has the same structure. Relevant info:
. column B - time string
. column C - value
- The files are automatically genarated and report lots of single events (evaluated in Column C) that occurr in a specific time (dd/mm/yyyy hh:mm:ss specified in Column B)
- All files have the same number of lines.
- Line 2 in fileX refers to the same time as Line 2 in fileY; the same for all lines.
What I need is a Macro in a file "Master.xls" placed in folder MP1 to automatically:
1. open each file in the subfolders
2. copy the time string (column B) for A2 down - only needed for the first file
3. copy the relevant info (column C) - in every file
4. close all files
Result: I have a "Master" file with the relevant info of all the others, preceeded by a time string from where I can work (pivot table, graph, etc.). The files can have from 5.000 to 30.000 lines, depending on the day.
P.S. The MP1 folder path should not be locked, I should be able to move this folder around, but its substructure will always remain the same.
Thanks in advance.
- I have the following folder/file structure:
MP1
CT
CTfile1.csv
CTfile2.csv
CV
CVfile1.csv
CVfile2.csv
FT
FTfile1.csv
FTfile2.csv
...etc - it keeps on going for more subfolders.
- Every subfolder has 2 different .csv files.
- Every file has the same structure. Relevant info:
. column B - time string
. column C - value
- The files are automatically genarated and report lots of single events (evaluated in Column C) that occurr in a specific time (dd/mm/yyyy hh:mm:ss specified in Column B)
- All files have the same number of lines.
- Line 2 in fileX refers to the same time as Line 2 in fileY; the same for all lines.
What I need is a Macro in a file "Master.xls" placed in folder MP1 to automatically:
1. open each file in the subfolders
2. copy the time string (column B) for A2 down - only needed for the first file
3. copy the relevant info (column C) - in every file
4. close all files
Result: I have a "Master" file with the relevant info of all the others, preceeded by a time string from where I can work (pivot table, graph, etc.). The files can have from 5.000 to 30.000 lines, depending on the day.
P.S. The MP1 folder path should not be locked, I should be able to move this folder around, but its substructure will always remain the same.
Thanks in advance.
Last edited: