LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices


Old

How to replace letters with carriage returns on VIM

Posted 10-27-2010 at 12:35 PM by xri
Updated 10-27-2010 at 12:38 PM by xri (To add categories)

Problem:
A text file coms with a list comes with the items separated by commas, like:
Quote:
a,b,c....
We need them in column form, like:
Quote:
a
b
c
Solution:
:%s/,/{[Ctrl+v], then [Enter]}/g

Notes:
  1. The % before s, indicates that the range where the replacement is to take place is the whole document.
  2. Ctrl and v are pressed simultaneously, and then the character we mean vim to use (in this case Return).
  3. The g at the end of the
...
xri
Member
Posted in Software
Views 1907 Comments 0 xri is offline

  



All times are GMT -5. The time now is 03:54 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration