Hi.
Can somebody please tell me how best to import a .log file into an excel worksheet (2002) via a macro. I would like the macro to allow (direct) the user to select the .log file from a directory, just as you would use explore to locate file.
A sample of log data is shown here. The first six lines of the file is simply a summary of the dataset (whish I would like to keep). The main data follows the summary, and although the headers do not look to be inline with the data in this example, if the .log file is opened with excel, the data is presented as desired (each header and appropriate data) incolumns of their own.
Once the data is in excel, I can then manipulate, summarise and plot the data.
Thanks in advance.
C:\Program Files\Data Manager\Datalogs\Main_Data1106101043.log
Unit: Main Back
Started: 10/06/2011 10:43:31
Operator: op
Begin Lot Information:
I000109-49units,testunit-1unit
End Lot Information
Run time, mins. Entry Date Entry Time Setpoint °C Temperature °C O2 Level ppm Hi-Limit Alarm Soak Dev Alarm Alarm Outputs Event Outputs
0.00 10/06/2011 10:43:31 82 77 215822 0 0 0000 0000
0.07 10/06/2011 10:43:35 77 77 215924 0 0 0000 0000
0.60 10/06/2011 10:44:07 77 76 181470 0 0 0000 0000
1.13 10/06/2011 10:44:39 77 76 127552 0 0 0000 0000
1.65 10/06/2011 10:45:10 77 76 90468 0 0 0000 0000
2.18 10/06/2011 10:45:42 77 76 63381 0 0 0000 0000
2.72 10/06/2011 10:46:14 77 76 44616 0 0 0000 0000
3.25 10/06/2011 10:46:46 77 75 31309 0 0 0000 0000
3.77 10/06/2011 10:47:17 77 75 21875 0 0 0000 0000
4.30 10/06/2011 10:47:49 77 75 14790 0 0 0000 0000
4.82 10/06/2011 10:48:20 77 75 9870 0 0 0000 0000
5.32 10/06/2011 10:48:50 77 75 6068 0 0 0000 0000
5.83 10/06/2011 10:49:21 76 75 3475 0 0 0000 0000
6.37 10/06/2011 10:49:53 76 74 1548 0 0 0000 0000
6.90 10/06/2011 10:50:25 76 74 3958 0 0 0000 0000
7.43 10/06/2011 10:50:57 76 74 3355 0 0 0000 0000
Can somebody please tell me how best to import a .log file into an excel worksheet (2002) via a macro. I would like the macro to allow (direct) the user to select the .log file from a directory, just as you would use explore to locate file.
A sample of log data is shown here. The first six lines of the file is simply a summary of the dataset (whish I would like to keep). The main data follows the summary, and although the headers do not look to be inline with the data in this example, if the .log file is opened with excel, the data is presented as desired (each header and appropriate data) incolumns of their own.
Once the data is in excel, I can then manipulate, summarise and plot the data.
Thanks in advance.
C:\Program Files\Data Manager\Datalogs\Main_Data1106101043.log
Unit: Main Back
Started: 10/06/2011 10:43:31
Operator: op
Begin Lot Information:
I000109-49units,testunit-1unit
End Lot Information
Run time, mins. Entry Date Entry Time Setpoint °C Temperature °C O2 Level ppm Hi-Limit Alarm Soak Dev Alarm Alarm Outputs Event Outputs
0.00 10/06/2011 10:43:31 82 77 215822 0 0 0000 0000
0.07 10/06/2011 10:43:35 77 77 215924 0 0 0000 0000
0.60 10/06/2011 10:44:07 77 76 181470 0 0 0000 0000
1.13 10/06/2011 10:44:39 77 76 127552 0 0 0000 0000
1.65 10/06/2011 10:45:10 77 76 90468 0 0 0000 0000
2.18 10/06/2011 10:45:42 77 76 63381 0 0 0000 0000
2.72 10/06/2011 10:46:14 77 76 44616 0 0 0000 0000
3.25 10/06/2011 10:46:46 77 75 31309 0 0 0000 0000
3.77 10/06/2011 10:47:17 77 75 21875 0 0 0000 0000
4.30 10/06/2011 10:47:49 77 75 14790 0 0 0000 0000
4.82 10/06/2011 10:48:20 77 75 9870 0 0 0000 0000
5.32 10/06/2011 10:48:50 77 75 6068 0 0 0000 0000
5.83 10/06/2011 10:49:21 76 75 3475 0 0 0000 0000
6.37 10/06/2011 10:49:53 76 74 1548 0 0 0000 0000
6.90 10/06/2011 10:50:25 76 74 3958 0 0 0000 0000
7.43 10/06/2011 10:50:57 76 74 3355 0 0 0000 0000