• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Extracting data from a log file

hondahawkrider

New Member
Extracting data from text/log file



Having a little difficulty...and was hoping to be pointed in the right direction

I have a huge amdas log file with lots of data - several thousand rows

I am looking to parse two lines so i could do a comparison between the timestamp

The beginning line is
INFO : 2020-11-06 13:58:54.814: (thread: 1333782272): ==> Received payload from Postfix

The ending line is
INFO : 2020-11-06 13:58:55.449: (thread: 1333782272): ==> TRANSACTION completed.

There are several lines in-between - the unique values are "Received payload from Postfix" and "TRANSACTION completed" …
and there will be several received/competed per log file

Where I am attempting to get the Received time stamp into column A and completed time stamp to column B..
I can import the file, not problem but having issues with the values, and help is appreciated... My macro skill are rusty..
sample log files attached

 

Attachments

vletm

Excel Ninja
hondahawkrider
Your file has one pair of those Your needed lines.
Screenshot 2020-11-11 at 20.43.08.png
Your I (You) can import the file, not problem but having issues with the values
You can adjust wanted formats for date (B-column) eg dd-mmm-yyyy as well as time (C-column) eg hh:mm:ss.
Where do You need VBA? ... You could do those few steps manually.
 

hondahawkrider

New Member
hondahawkrider
Your file has one pair of those Your needed lines.
View attachment 72021
Your I (You) can import the file, not problem but having issues with the values
You can adjust wanted formats for date (B-column) eg dd-mmm-yyyy as well as time (C-column) eg hh:mm:ss.
Where do You need VBA? ... You could do those few steps manually.
The actual files will have several instance of postfix/completed... I need the vba to pars out the Postfix ones to column A and the completed ones to column b … not all in one collum...

FWIW - the sample only has one instance of each … There will be multiple ones..

Thanks in advance
 

vletm

Excel Ninja
hondahawkrider
Where do You need the VBA? You need some results.
Some things could solve with VBA - not everything.
Your sample should have same features which You would use in the ... real life.
If there is as now - total ... one pair - then case would be different.
It's Your choice ...
 
Top