Thanks for your response. But actually my task has become a little more complex now, please consider my requirement as follows,
I have 2 log files created from 2 different locations. So, first i want to merge the 2 log files ( text files). The merging should be done line by line, based on the time stamp.
Here is the sample log,
[20/01/2009 17:32:41] INFO (HTTPSClientApp.java:111) - Website is available HTTP/1.1 200 OK
[20/01/2009 17:33:41] INFO (HTTPSClientApp.java:111) - Website is available HTTP/1.1 200 OK
[20/01/2009 17:34:41] INFO (HTTPSClientApp.java:111) - Website is available HTTP/1.1 200 OK
So, the script should check the time stamp in each line & merge the 2 files line by line in ascending order.
After merging the files, the script should read the merged file line by line & look for the keyword "HTTP/1.1 200 OK" (basically it should check if the website is available). If the keyword is missing consecutively in 2 lines then it should take the time stamp of the second line & it should check through the next consecutive lines for the keyword "HTTP/1.1 200 OK". Once it finds the next "HTTP/1.1 200 OK", it should subtract the time stamp of the "HTTP/1.1 200 OK" line with the previous time stamp noted. So that we can calculate the downtime. Like this it should sum up all the downtimes and print it to a file at the end. This will be done at the end of every month.
It will be a great help if you can help me to create a script for this task. It can be in any scripting language. Since am very new to scripting, kindly help me to create complete script for this task. I will be happy to donate for this forum, bcoz this is much important for me.