The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 10-08-2008
shellscripter shellscripter is offline
Registered User
  
 

Join Date: Oct 2008
Location: chennai
Posts: 16
Question Parsing out the logs and generating report

My file will contain following(log.txt):

start testcase: config loading
......
error XXXX
.....
end testcase: config loading, result failed
start testcase: ping check
.....
error ZZZZZ
.....
error AAAAA
end testcase: Ping check, result failed

I am expecting below output.
=========================================
Testcase: config loading
error XXXX
Testcase: ping check
error ZZZZ
error AAAA
==============================================

There are so many testcases like this in file also the number of error in testcase will vary.

Please give better idea using shell script. Your help will be appreciated.

Thanks