vi editor

Tags
advanced

 
Thread Tools Search this Thread
# 1  
Old 07-02-2005
vi editor

Hi,
how can I add at the begining and at the end of all of the lines of my text file in VI editor ? Many thanks before.
for exemple if in my file i have
line 1
line 2
I want to have :
start line 1 end
start line 2 end
# 2  
Old 07-02-2005
Code:
:%s/^\(.*\)$/start \1 end/

# 3  
Old 07-03-2005
Thank you.
What if instead of start I want to put : DROP TABLESPACE
and instead of end : INCLUDING CONTENTS.
Many thanks again.
# 4  
Old 07-21-2005
quite the same:

: 1,$ s/.*/DROP TABLESPACE & INCLUDING CONTENTS/

Replace "DROP TABLESPACE" with any other text you may want to put at the beginning of the line and "INCLUDING CONTENTS" with any other text you may want to put at the end.

bakunin

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
What editor does everyone use? yongho Open Source 401 5 Days Ago 05:58 AM
How can I do this in VI editor? kraljic Shell Programming and Scripting 9 03-09-2013 10:47 PM
Help with vi editor gonchusirsa UNIX for Dummies Questions & Answers 1 01-19-2013 12:55 AM
Vi Editor Sudip_Felipemas UNIX for Dummies Questions & Answers 6 02-02-2012 08:01 AM
Help in Vi Editor gameboy87 Programming 2 09-16-2011 11:05 PM
Vi editor jazz Programming 2 05-08-2009 09:46 AM
Epic Editor was not able to obtain a license for your use. Feature Epic Editor :Licen durgaprasadr13 Solaris 1 10-13-2008 08:39 AM
set EDITOR=vi -> default editor not setting for cron tab aarora_98 Shell Programming and Scripting 6 09-13-2008 03:01 AM
Pasting text in VI editor from a different editor harishmitty UNIX for Dummies Questions & Answers 10 09-10-2008 07:22 PM
VI Editor doyindayo UNIX and Linux Applications 3 08-26-2008 09:14 AM
Which editor to use? Nafanja UNIX for Dummies Questions & Answers 5 11-29-2007 12:58 PM
vi editor MaxK UNIX for Dummies Questions & Answers 2 10-18-2006 11:42 PM
vi editor diptiman Solaris 15 05-21-2006 12:55 PM
best editor annemar UNIX Desktop Questions & Answers 1 10-10-2005 01:05 PM
Vi editor ? billy5 Shell Programming and Scripting 2 06-27-2005 05:20 PM