Wednesday, February 22, 2006

Vi Editor --- Adding a Word at the Beginning and Ending of all lines in a File

To add a word at the end of all lines in a file :

:%s/$/LastWord /g


To add a word at the beginning of all lines in a file:

:%s/^/FirstWord /g




No comments: