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
retrieved multiple lines on multiple places in a file dala Shell Programming and Scripting 8 03-14-2008 03:28 PM
error: initializer expression list treated as compound expression arunchaudhary19 High Level Programming 12 11-16-2007 06:44 AM
Expression for Finding Multiple Directories..?? meskue Shell Programming and Scripting 3 07-10-2006 03:04 PM
How to choose Multiple process or Multiple threads? ashleykumar IP Networking 0 04-10-2006 06:30 AM
Regular Expression + Aritmetical Expression Z0mby Shell Programming and Scripting 2 05-21-2002 10:59 AM

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-15-2008
finalight finalight is offline
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?
  #2 (permalink)  
Old 05-15-2008
rubin's Avatar
rubin rubin is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2007
Posts: 321
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
  #3 (permalink)  
Old 05-15-2008
finalight finalight is offline
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
  #4 (permalink)  
Old 05-16-2008
rubin's Avatar
rubin rubin is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2007
Posts: 321
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.
  #5 (permalink)  
Old 05-16-2008
finalight finalight is offline
Registered User
  
 

Join Date: May 2008
Posts: 51
it recognizes awk, but it doesn't recognizes '/^\' this particular pattern
  #6 (permalink)  
Old 05-16-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
"Event not found" is a message from your shell. You need to use different quoting (though I don't understand how it could say that if you use single quotes; which shell are you using?)
  #7 (permalink)  
Old 05-15-2008
Annihilannic Annihilannic is offline Forum Advisor  
  
 

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

Code:
grep -v '^[(=]' inputfile > outputfile
Closed Thread

Bookmarks

Tags
solaris

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 05:46 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