Hello. I have searched across this forum for an exact answer but find many other examples which don't quite fit.
I'm on a two-year research project in college, looking into continuous (minute-interval) heat pump and room temperature measurements.
My objective is to append (new) timestamped data to a Master .xlsx workbook from a freshly downloaded .csv file and also, to summarise the data, instead of using (the wonderful) Pivot table after each download. This is to be done for 20 different Master files (from 20 different csv files), at least once per month.
Each downloaded .csv defaults to a full year of minute-interval data (around 500,000 rows is typical due to missing data) so I only need to copy the most recent data, to the corresponding Master file (see attached files as an explanation). The Master and csv files both contain 8 columns (A to H) of data.
Master File data example.JPG
While the csv file corresponding to each Master file will be unique, each downloaded csv file is always given the same name: CSVReport.csv
For ease, the folder and filename structure simply follows an XHyy identifier number (where yy is the two-digit number 01, 02, 03,..., up to 20), for example, the Master file for XH01 is found in:
P:\Data Analysis\1.1 Data Management\Master Files\XH01\XH01 Master 12Dec17.xlsx (note: the 12Dec17 is the date that the most recent csv file was downloaded)
and the corresponding CSVReport file is held in:
P:\Data Analysis\1.1 Data Management\Master Files\XH01\XH01 csv\CSVReport.csv
The order of events is:
1. The Master file will be open e.g. XH01 Master 12Dec17.xlsx
2. The corresponding CSVReport.csv file will be in the corresponding XHyy folder, as in the above directory path/filename
3. Run the code so that only the most recent data from the csv file is copied/appended to the XHyy Master file.
4. A monthly summary of the data, consisting of two SUM columns, four AVERAGE columns and one COUNT column (see Sheet2 of attached XH01 Master 12Dec17.xlsx)
I hope I have explained (and not over-explained) concisely, and thanks to all who spend time on this.
Bookmarks