The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
command for selecting specific lines from a script gardasgangadhar UNIX for Dummies Questions & Answers 1 05-13-2008 05:29 AM
merge based on common, awk help jkl_jkl Shell Programming and Scripting 3 03-17-2008 07:13 AM
Help with selecting specific lines in a large file tansha UNIX for Dummies Questions & Answers 2 02-06-2008 08:26 AM
how to take out common of two lines in a file jam_ali49 UNIX for Advanced & Expert Users 6 11-23-2007 04:48 AM
Search file for pattern and grab some lines before pattern frustrated1 Shell Programming and Scripting 2 12-22-2005 03:41 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-28-2008
damansingh damansingh is offline
Registered User
  
 

Join Date: May 2008
Posts: 11
selecting only few lines from many based on a common pattern

Hi,
I have a file having some thousand records with the following sort of lines:

Error: Failed to get order data
Order: PO-BBBTGZE
Error: No CLI
Error: Failed to get order data
Order: PO-SBDJUZA
Order: PO-XBBIDEN
Error: No CLI
Error: Failed to get order data
Order: PO-BBDJUTQ
Order: PO-FBCSPHC
Error: No CLI
Error: Failed to get order data
Order: PO-FLBVKYV
Error: No CLI
Error: Failed to get order data
Order: PO-KBDASSI
Order: PO-HBBGQCE
Error: No CLI
Error: Failed to get order data
Order: PO-RBDDJKT
Order: PO-RBDDJKM
Error: No CLI
Error: Failed to get order data
Order: PO-EBDCFLJ

I wish to only retrieve the lines marked red and none else. i.e. any line with the line after it starting in ERROR is not desired.

Any Directions shall be highly appreciated.
  #2 (permalink)  
Old 05-28-2008
damansingh damansingh is offline
Registered User
  
 

Join Date: May 2008
Posts: 11
Hi,
Can anyone please help me ?
  #3 (permalink)  
Old 05-28-2008
siba.s.nayak siba.s.nayak is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 164
grep -v "^Error" <file name>
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:02 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0