Is this doable or not?
Posted: 06 Jul 2011 06:29
Hi everyone,
I am wondering if this is doable.
I have a log file with these contents:
source.log
what i am trying to do is to find this line "webServer= http://webcodingtpp.nl.post.tnt:80/serv ... renServlet" and if found it will create a text file with the filename of the last word of the searched line(eg. TPP-ProductcoderenServlet) and will extract the below lines until it reaches a line equal to this "webServer= http://webcodingtpp.nl.post.tnt:80/serv ... renServlet" and will to the same until it reaches the end.
to make it clear, using source above, the output will be like this:
TPP-ProductcoderenServlet.txt
TPP-BestemmingscoderenServlet.txt
is this possible?
thanks in advance.
I am wondering if this is doable.
I have a log file with these contents:
source.log
Code: Select all
basic: Applet initialized
webServer= http://webcodingtpp.nl.post.tnt:80/servlet/TPP-ProductcoderenServlet
[05 Jul 2011 01:59:04.151] Getting the image from the server:3768 msec.
[05 Jul 2011 01:59:04.151] Queueing the image: 389 msec.
[05 Jul 2011 01:59:04.151] Preparing/scaling the image: 529 msec.
[05 Jul 2011 01:59:04.151] Displaying the image: 0 msec.
[05 Jul 2011 01:59:04.151] Coding the image: 2374 msec.
[05 Jul 2011 01:59:04.151] --------------------------------
[05 Jul 2011 01:59:04.151] requestGET = http://webcodingtpp.nl.post.tnt:80/servlet/TPP-ProductcoderenServlet?letterId=[05 Jul 2011 04:38:45.322] setResult()
[05 Jul 2011 04:38:45.322] result = 1
[05 Jul 2011 04:38:45.322] country = NL
[05 Jul 2011 04:38:45.322] pc = 5140WR
[05 Jul 2011 04:38:45.322] hnr = 25000
[05 Jul 2011 04:38:45.322] olHnr = 25000
[05 Jul 2011 04:38:45.322] olExt =
[05 Jul 2011 04:38:45.322] ---Timing-----------------------
[05 Jul 2011 04:38:45.322] Getting the image from the server:1868 msec.
[05 Jul 2011 04:38:45.322] Queueing the image: 234 msec.
[05 Jul 2011 04:38:45.322] Preparing/scaling the image: 109 msec.
[05 Jul 2011 04:38:45.322] Displaying the image: 0 msec.
[05 Jul 2011 04:38:45.322] Coding the image: 3813 msec.
[05 Jul 2011 04:38:45.322] --------------------------------
webServer= http://webcodingtpp.nl.post.tnt:80/servlet/TPP-BestemmingscoderenServlet
[05 Jul 2011 01:59:04.151] Getting the image from the server:3768 msec.
[05 Jul 2011 01:59:04.151] Queueing the image: 389 msec.
[05 Jul 2011 01:59:04.151] Preparing/scaling the image: 529 msec.
[05 Jul 2011 01:59:04.151] Displaying the image: 0 msec.
[05 Jul 2011 01:59:04.151] Coding the image: 2374 msec.
[05 Jul 2011 01:59:04.151] --------------------------------
[05 Jul 2011 01:59:04.151] requestGET = http://webcodingtpp.nl.post.tnt:80/servlet/TPP-ProductcoderenServlet?letterId=[05 Jul 2011 04:38:45.322] setResult()
[05 Jul 2011 04:38:45.322] result = 1
[05 Jul 2011 04:38:45.322] country = NL
[05 Jul 2011 04:38:45.322] pc = 5140WR
[05 Jul 2011 04:38:45.322] hnr = 25000
[05 Jul 2011 04:38:45.322] olHnr = 25000
[05 Jul 2011 04:38:45.322] olExt =
[05 Jul 2011 04:38:45.322] ---Timing-----------------------
[05 Jul 2011 04:38:45.322] Getting the image from the server:1868 msec.
[05 Jul 2011 04:38:45.322] Queueing the image: 234 msec.
[05 Jul 2011 04:38:45.322] Preparing/scaling the image: 109 msec.
[05 Jul 2011 04:38:45.322] Displaying the image: 0 msec.
[05 Jul 2011 04:38:45.322] Coding the image: 3813 msec.
[05 Jul 2011 04:38:45.322] --------------------------------
webServer= http://webcodingtpp.nl.post.tnt:80/servlet/TPP-ProductcoderenServlet
[05 Jul 2011 01:59:04.151] Getting the image from the server:3768 msec.
[05 Jul 2011 01:59:04.151] Queueing the image: 389 msec.
[05 Jul 2011 01:59:04.151] Preparing/scaling the image: 529 msec.
[05 Jul 2011 01:59:04.151] Displaying the image: 0 msec.
[05 Jul 2011 01:59:04.151] Coding the image: 2374 msec.
[05 Jul 2011 01:59:04.151] --------------------------------
[05 Jul 2011 01:59:04.151] requestGET = http://webcodingtpp.nl.post.tnt:80/servlet/TPP-ProductcoderenServlet?letterId=[05 Jul 2011 04:38:45.322] setResult()
[05 Jul 2011 04:38:45.322] result = 1
[05 Jul 2011 04:38:45.322] country = NY
[05 Jul 2011 04:38:45.322] pc = 6666WR
[05 Jul 2011 04:38:45.322] hnr = 35000
[05 Jul 2011 04:38:45.322] olHnr = 35000
[05 Jul 2011 04:38:45.322] olExt =
[05 Jul 2011 04:38:45.322] ---Timing-----------------------
[05 Jul 2011 04:38:45.322] Getting the image from the server:1868 msec.
[05 Jul 2011 04:38:45.322] Queueing the image: 2354 msec.
[05 Jul 2011 04:38:45.322] Preparing/scaling the image: 1109 msec.
[05 Jul 2011 04:38:45.322] Displaying the image: 10 msec.
[05 Jul 2011 04:38:45.322] Coding the image: 38513 msec.
[05 Jul 2011 04:38:45.322] --------------------------------
what i am trying to do is to find this line "webServer= http://webcodingtpp.nl.post.tnt:80/serv ... renServlet" and if found it will create a text file with the filename of the last word of the searched line(eg. TPP-ProductcoderenServlet) and will extract the below lines until it reaches a line equal to this "webServer= http://webcodingtpp.nl.post.tnt:80/serv ... renServlet" and will to the same until it reaches the end.
to make it clear, using source above, the output will be like this:
TPP-ProductcoderenServlet.txt
Code: Select all
webServer= http://webcodingtpp.nl.post.tnt:80/servlet/TPP-ProductcoderenServlet
[05 Jul 2011 01:59:04.151] Getting the image from the server:3768 msec.
[05 Jul 2011 01:59:04.151] Queueing the image: 389 msec.
[05 Jul 2011 01:59:04.151] Preparing/scaling the image: 529 msec.
[05 Jul 2011 01:59:04.151] Displaying the image: 0 msec.
[05 Jul 2011 01:59:04.151] Coding the image: 2374 msec.
[05 Jul 2011 01:59:04.151] --------------------------------
[05 Jul 2011 01:59:04.151] requestGET = http://webcodingtpp.nl.post.tnt:80/servlet/TPP-ProductcoderenServlet?letterId=[05 Jul 2011 04:38:45.322] setResult()
[05 Jul 2011 04:38:45.322] result = 1
[05 Jul 2011 04:38:45.322] country = NL
[05 Jul 2011 04:38:45.322] pc = 5140WR
[05 Jul 2011 04:38:45.322] hnr = 25000
[05 Jul 2011 04:38:45.322] olHnr = 25000
[05 Jul 2011 04:38:45.322] olExt =
[05 Jul 2011 04:38:45.322] ---Timing-----------------------
[05 Jul 2011 04:38:45.322] Getting the image from the server:1868 msec.
[05 Jul 2011 04:38:45.322] Queueing the image: 234 msec.
[05 Jul 2011 04:38:45.322] Preparing/scaling the image: 109 msec.
[05 Jul 2011 04:38:45.322] Displaying the image: 0 msec.
[05 Jul 2011 04:38:45.322] Coding the image: 3813 msec.
[05 Jul 2011 04:38:45.322] --------------------------------
webServer= http://webcodingtpp.nl.post.tnt:80/servlet/TPP-ProductcoderenServlet
[05 Jul 2011 01:59:04.151] Getting the image from the server:3768 msec.
[05 Jul 2011 01:59:04.151] Queueing the image: 389 msec.
[05 Jul 2011 01:59:04.151] Preparing/scaling the image: 529 msec.
[05 Jul 2011 01:59:04.151] Displaying the image: 0 msec.
[05 Jul 2011 01:59:04.151] Coding the image: 2374 msec.
[05 Jul 2011 01:59:04.151] --------------------------------
[05 Jul 2011 01:59:04.151] requestGET = http://webcodingtpp.nl.post.tnt:80/servlet/TPP-ProductcoderenServlet?letterId=[05 Jul 2011 04:38:45.322] setResult()
[05 Jul 2011 04:38:45.322] result = 1
[05 Jul 2011 04:38:45.322] country = NY
[05 Jul 2011 04:38:45.322] pc = 6666WR
[05 Jul 2011 04:38:45.322] hnr = 35000
[05 Jul 2011 04:38:45.322] olHnr = 35000
[05 Jul 2011 04:38:45.322] olExt =
[05 Jul 2011 04:38:45.322] ---Timing-----------------------
[05 Jul 2011 04:38:45.322] Getting the image from the server:1868 msec.
[05 Jul 2011 04:38:45.322] Queueing the image: 2354 msec.
[05 Jul 2011 04:38:45.322] Preparing/scaling the image: 1109 msec.
[05 Jul 2011 04:38:45.322] Displaying the image: 10 msec.
[05 Jul 2011 04:38:45.322] Coding the image: 38513 msec.
[05 Jul 2011 04:38:45.322] --------------------------------
TPP-BestemmingscoderenServlet.txt
Code: Select all
webServer= http://webcodingtpp.nl.post.tnt:80/servlet/TPP-BestemmingscoderenServlet
[05 Jul 2011 01:59:04.151] Getting the image from the server:3768 msec.
[05 Jul 2011 01:59:04.151] Queueing the image: 389 msec.
[05 Jul 2011 01:59:04.151] Preparing/scaling the image: 529 msec.
[05 Jul 2011 01:59:04.151] Displaying the image: 0 msec.
[05 Jul 2011 01:59:04.151] Coding the image: 2374 msec.
[05 Jul 2011 01:59:04.151] --------------------------------
[05 Jul 2011 01:59:04.151] requestGET = http://webcodingtpp.nl.post.tnt:80/servlet/TPP-ProductcoderenServlet?letterId=[05 Jul 2011 04:38:45.322] setResult()
[05 Jul 2011 04:38:45.322] result = 1
[05 Jul 2011 04:38:45.322] country = NL
[05 Jul 2011 04:38:45.322] pc = 5140WR
[05 Jul 2011 04:38:45.322] hnr = 25000
[05 Jul 2011 04:38:45.322] olHnr = 25000
[05 Jul 2011 04:38:45.322] olExt =
[05 Jul 2011 04:38:45.322] ---Timing-----------------------
[05 Jul 2011 04:38:45.322] Getting the image from the server:1868 msec.
[05 Jul 2011 04:38:45.322] Queueing the image: 234 msec.
[05 Jul 2011 04:38:45.322] Preparing/scaling the image: 109 msec.
[05 Jul 2011 04:38:45.322] Displaying the image: 0 msec.
[05 Jul 2011 04:38:45.322] Coding the image: 3813 msec.
[05 Jul 2011 04:38:45.322] --------------------------------
is this possible?
thanks in advance.