The UNIX and Linux Forums
>
Top Forums
>
UNIX for Dummies Questions & Answers
vi + regexp + substitute
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
vi + regexp + substitute
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
1
(
permalink
)
12-10-2004
Lomic
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
Lomic
View Public Profile
Find all posts by Lomic
Find Lomic's past nominations received
Find Lomic's present nominations given