The UNIX and Linux Forums  

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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
retrieved multiple lines on multiple places in a file dala Shell Programming and Scripting 8 03-14-2008 12:28 PM
error: initializer expression list treated as compound expression arunchaudhary19 High Level Programming 12 11-16-2007 03:44 AM
Expression for Finding Multiple Directories..?? meskue Shell Programming and Scripting 3 07-10-2006 12:04 PM
How to choose Multiple process or Multiple threads? ashleykumar IP Networking 0 04-10-2006 03:30 AM
Regular Expression + Aritmetical Expression Z0mby Shell Programming and Scripting 2 05-21-2002 07:59 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-15-2008
Registered User
 

Join Date: May 2008
Posts: 51
need help on multiple expression

this is the content of the file:

Quote:
AutoMicro Job Request
================================
(1). Job Request Information
================================
Date of Request: 20080514 10:37 Submitted By: xxx
First Carrier: xxx Date of Process: 20080514 10:38

================================
(2). Plan Summary By Connection
================================
| Previous | | Current |
Conn Total Plan Usr Prev Can Has
Vsl Voy Type Qty Qty Plan Plan Plan Plan Reason**
--- --- ---- ----- --- ---- ---- ---- ---- ------
xxx 254 xxx 11 0 0 0 11 11
**Reason: [P]: Cannot Plan Fully [O]: Not In Planning Scope [C]: No Cluster
[b]: Big Volume [i]: Band 1 HLD Connection [S]: Not Selected
[N]: No BKDN to Plan [H]: Holding Volume Too High [F]: No Feasible space

==========================================
(3). Plan Details For Connecting Carriers
==========================================
Vsl Voy Port Sz Cat Wt Block Slot Row Qty Crane OperCode ResvFor
xxx 254 xx 40 HC M U02 25 6 4 0
xx 20 GP H U02 27 3 1 0
xx 20 GP U U02 27 3 1 0
xx 40 HC X U02 25 4 3 0
xx 40 HC U U02 25 6 1 0
xx 20 GP L U02 27 3 1 0
i want to remove both the line starting with "=" and "(" but i can only remove one at a time..so how do I go about removing both of them?
Reply With Quote
Forum Sponsor
  #2  
Old 05-15-2008
rubin's Avatar
Registered User
 

Join Date: Nov 2007
Posts: 215
Quote:
Originally Posted by finalight View Post
...
i want to remove both the line starting with "=" and "(" but i can only remove one at a time..so how do I go about removing both of them?
One way:

Code:
awk  '!/^\=+/ && !/^\(/ '  your_file
Reply With Quote
  #3  
Old 05-15-2008
 

Join Date: May 2008
Location: Sydney, Australia
Posts: 917
Something like this?

Code:
grep -v '^[(=]' inputfile > outputfile
Reply With Quote
  #4  
Old 05-15-2008
Registered User
 

Join Date: May 2008
Posts: 51
now i got another problem

my dashes "---" "---" are not at the first line, and iwant to remove them as well
however when i try to do this:

Quote:
grep -v '[=-(]' test.txt
it won;t remove the dashes at all
Reply With Quote
  #5  
Old 05-15-2008
Registered User
 

Join Date: May 2008
Posts: 51
Quote:
Originally Posted by rubin View Post
One way:

Code:
awk  '!/^\=+/ && !/^\(/ '  your_file
can you please explain the pattern to me?

and it says event not found
Reply With Quote
  #6  
Old 05-15-2008
rubin's Avatar
Registered User
 

Join Date: Nov 2007
Posts: 215
To remove the dashes too, use:

Code:
awk '!/^\=+|^\(|^\-+/' your_file
If your OS doesn't recognize awk , try nawk or /usr/xpg4/bin/awk on solaris.
Reply With Quote
  #7  
Old 05-15-2008
Registered User
 

Join Date: May 2008
Posts: 51
it recognizes awk, but it doesn't recognizes '/^\' this particular pattern
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
solaris

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 07:42 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0