Yeah so today we received a request to pull the arrival times that a certain train (M204) arrived in LAUS for the past year.
Believe it or not, I guess nobody has ever asked that before. All of the tools at our disposal failed. They could not even produce a single DAY.
So I had the brilliant idea to take Excel, make a command button and I put in a macro that should look through several hundred log files and display every date and the time that that train was at a certain milepost.
Cept it does not do that...
Currently I have a macro that will search through all of the files and pull out a string of text and sub strings I guess, but damn. Each line has a lot of data/garbage that I do not need. (which I use the INSTR command to pull out substrings)
I am looking to have Excel look through about 600+ log files that are anywhere from 50-300MB large and pull out every time the train 204 pulled into the station. There is a certain string of text that the log files display showing the mile post for the beginning and end of the train. I just need Cell A2 to show the date, B2 to show the time and C2 to show the milepost it was at at that time.
The log files are TXT files that are essentially lines of code that you can read and pick out certain events and all, but there is no CSV or spaces, it is all spaced out or ran together.
So I guess I want the macro to look at each log file, find the piece of the code that shows M204 AND the milepost (xxx.xxxx) and then put it into a workbook that I can save and forward to the higher ups.
Where would I go to read up on such a thing? So far I got my macro to parse through the files and pull the FIRST instance on seeing M204, but the train could be listed several hundred times AND in some cases, it could also NOT be listed (M204 does not run on the weekends). So there can be no errors generated due to a log file that does not list M204.
My vba skills are weak. I think I learned most of the puzzle tonight but damn, I would sure love to be able to complete it.
Stack overflow has some certain pages I saw, but I had to keep looking.
Is there a good bible or cook book for Excel 2016?
Any help here is appreciated. I am looking for EXCEL VBA resources and stuff. I am not very familiar with the commands. Time to go get an e-book or two I think.
Thanks for your time if you are still awake.
Believe it or not, I guess nobody has ever asked that before. All of the tools at our disposal failed. They could not even produce a single DAY.
So I had the brilliant idea to take Excel, make a command button and I put in a macro that should look through several hundred log files and display every date and the time that that train was at a certain milepost.
Cept it does not do that...

Currently I have a macro that will search through all of the files and pull out a string of text and sub strings I guess, but damn. Each line has a lot of data/garbage that I do not need. (which I use the INSTR command to pull out substrings)
I am looking to have Excel look through about 600+ log files that are anywhere from 50-300MB large and pull out every time the train 204 pulled into the station. There is a certain string of text that the log files display showing the mile post for the beginning and end of the train. I just need Cell A2 to show the date, B2 to show the time and C2 to show the milepost it was at at that time.
The log files are TXT files that are essentially lines of code that you can read and pick out certain events and all, but there is no CSV or spaces, it is all spaced out or ran together.
So I guess I want the macro to look at each log file, find the piece of the code that shows M204 AND the milepost (xxx.xxxx) and then put it into a workbook that I can save and forward to the higher ups.
Where would I go to read up on such a thing? So far I got my macro to parse through the files and pull the FIRST instance on seeing M204, but the train could be listed several hundred times AND in some cases, it could also NOT be listed (M204 does not run on the weekends). So there can be no errors generated due to a log file that does not list M204.
My vba skills are weak. I think I learned most of the puzzle tonight but damn, I would sure love to be able to complete it.
Stack overflow has some certain pages I saw, but I had to keep looking.
Is there a good bible or cook book for Excel 2016?
Any help here is appreciated. I am looking for EXCEL VBA resources and stuff. I am not very familiar with the commands. Time to go get an e-book or two I think.
Thanks for your time if you are still awake.



Comment