Click here to Skip to main content
15,891,864 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi.
I have a file which logs some data while running the test case.
file name - Teju.log
This is the part of text form Teju.log

2015-10-05 10:50:13.997 TR [Comp.cc :2 - stop ]( 9115) [ 0] >> Trying to stop 'Comp'

Problem:

I want to capture the time when we get the message "Trying to stop 'Comp'"

Can anyone please help me to solve it. I have to write it in java
Posted
Updated 5-Oct-15 0:44am
v2

1 solution

So get writing. Study the classes required to read a file and the one for manipulating strings. See https://docs.oracle.com/javase/tutorial/essential/io/file.html[^] etc.
 
Share this answer
 
Comments
Member 12018498 7-Oct-15 1:03am    
Thank you for suggestion. I tried it using newBufferedReader(Path, Charset) and printing the data in column wise. But my question is how can I print the data in certain column based on a condition.I want to give one condition " Trying to stop 'Comp'" and get the data in second column
Richard MacCutchan 7-Oct-15 6:43am    
Use one of the string methods that will split the line into separate pieces.
Member 12018498 8-Oct-15 2:52am    
Thank you. I used split and then done with help of loop.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900