The UNIX and Linux Forums  

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
regexp help TinCanFury Shell Programming and Scripting 0 04-06-2008 07:21 PM
In Help, Substitute Text ... solidhelix08 Shell Programming and Scripting 6 02-07-2008 05:21 AM
regexp with sed again!!! andy2000 Shell Programming and Scripting 2 05-03-2007 11:15 AM
Substitute in vi kingdbag UNIX for Dummies Questions & Answers 5 01-17-2007 02:42 PM
regexp penfold UNIX for Advanced & Expert Users 1 06-28-2005 08:45 AM

 
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 Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 12-10-2004
Lomic Lomic is offline
Registered User
  
 

Join Date: Dec 2004
Location: Paris
Posts: 20
vi + regexp + substitute

Another enigma (for me)

Using VI I edit some files in which I want to erase many lines I don't need anymore

usually I do something like that:
Code:
:%s/line_to_suppress//g

and it is doing fine

but in this case, the pattern to erase contains some special characters

so I do it like that:
Code:
:%s#line_to_suppress_with_special_characters##g

but, the only problem left is that I can't predict what will be the beginning of the line so I wish I could do something like that:
Code:
:%s/*line_to_suppress//g

but of course if I protect the pattern with # to prevent special characters to annoy me... the * don't work anymore

the best way would be to suppress each line containing my pattern, but I don't know how to do that

I'm sure it's pretty easy for many among you, so if one have a bit of time, it would help me a lot

Thanx
 

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 02:37 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