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 > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how do i pattern match a field with awk? someone123 Shell Programming and Scripting 4 06-03-2008 09:08 AM
Concatenating multiple lines to one line if match pattern phixsius Shell Programming and Scripting 13 01-24-2008 11:02 PM
Delete a block of text delimited by blank lines when pattern is found gleu Shell Programming and Scripting 17 12-16-2007 11:30 PM
how to use pattern match with grep rei UNIX for Dummies Questions & Answers 5 01-05-2007 04:33 AM
SED: match pattern & delete matched lines not4google Shell Programming and Scripting 7 11-22-2006 09:58 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-20-2006
JumboGeng JumboGeng is offline
Registered User
  
 

Join Date: Dec 2005
Posts: 3
How to delete lines do NOT match a pattern

On Unix, it is easy to get those lines that match a pattern, by
Code:
grep pattern file
or those lines that do not, by
Code:
grep -v pattern file
but I am editing a file on Windows with Ultraedit.
Ultraedit support regular expression based search and replace.
I can delete all the lines that match a pattern, by
Code:
s/^.*pattern.*$//
but how can I delete all the lines that do not match this pattern?
look ahead assertion may be an option, but it is not surpported in Ultraedit,
can any body help me with this?
  #2 (permalink)  
Old 09-20-2006
tayyabq8's Avatar
tayyabq8 tayyabq8 is offline Forum Advisor  
Moderator
  
 

Join Date: Nov 2004
Location: Bahrain
Posts: 579
Did you try:
Code:
s/^.*[^pattern].*$//
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 10:13 AM.


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