java
Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-11-2009, 14:01
balajipsg balajipsg is offline
Junior Member
 
Join Date: Nov 2009
Posts: 1
Default Reading Text File with Certain Conditions

Hi,
Pls guide me
My requriment is to display Null pointer Exception and Log Entry Lines.I displayed null pointer exception using
below coding .


Text Files Look Like:

Log Entry-- Date and Time

Excpetion: Null pointer Exception

Log Entry-- Date and Time



--->1 Line Log Entry-- Date and Time
---> 2
--->3 Line Line Excpetion: Stack overflow exception
---> 4
--->5 Line Log Entry-- Date and Time



Log Entry-- Date and Time

Excpetion: Null pointer Exception

Log Entry-- Date and Time.



while(stringvalue=reading line by line!=null )
{
if(stringvalue.contains("Null pointer Exceptions"))
{
S.O.P(stringvalue);
}
}

How to Display Log entry and Null pointer Exception Log Entry Lines
Reply With Quote
  #2  
Old 10-11-2009, 14:23
kjkoster kjkoster is offline
Forum Operator
 
Join Date: Jul 2008
Posts: 1,123
Default

Dear balajipsg,

Check out grep. That was designed to do this.

Kees Jan
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump