LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-10-2012, 03:19 AM   #1
drnjdtj
LQ Newbie
 
Registered: Feb 2012
Posts: 9

Rep: Reputation: Disabled
grep error


Hi,

I have an error logfile, that looks likes this

2012 Feb 09 09:12:34:824 GMT +1 New Line OK
gfgfdgdfgklghlgfdg
fdggfd
fgd
gfdgdf
2012 Feb 09 09:12:34:825 GMT +1 Some Error
fgfd
gdf
ggdf
gfd
fdg
fgdfdgfdgf
dg
fdgf
2012 Feb 09 09:12:34:826 GMT +1 New Line OK
gfhhg
2012 Feb 09 09:12:34:827 GMT +1 Different kind of Error
fgfd
2012 Feb 09 09:12:34:828 GMT +1 Error lala
fgfd
rggg
gf
gff
gdgfd
gfd
gfd
gf
gfd


So what I want is to get all the text in lines that contain Error and I want to see all the lines after that until the new line begins (a new line begins with the date time like this 2012 Feb 09 09:12:34:826 GMT +1).


So in this case the output I want should be like:

2012 Feb 09 09:12:34:825 GMT +1 Some Error
fgfd
gdf
ggdf
gfd
fdg
fgdfdgfdgf
dg
fdgf
2012 Feb 09 09:12:34:827 GMT +1 Different kind of Error
fgfd
2012 Feb 09 09:12:34:828 GMT +1 Error lala
fgfd
rggg
gf
gff
gdgfd
gfd
gfd
gf
gfd
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
syntax error for grep with if arch12 Linux - Newbie 3 07-28-2010 02:40 AM
[SOLVED] Grep error in Bashscript tuxianD Linux - Newbie 8 07-14-2010 07:50 AM
[SOLVED] grep syntax error? sl33p Linux - Newbie 3 05-23-2009 04:44 PM
grep and awk error bazzano Programming 2 04-06-2009 12:01 AM
"Undeleting" data using grep, but get "grep: memory exhausted" error SammyK Linux - Software 2 03-13-2004 03:11 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration