Solved

Inserting a CRLF in VI

Posted on 2002-07-22
5
1,848 Views
Last Modified: 2012-06-27
Can any one tell me how do we insert a CRLF from inside the vi in a text file ?!!!


Thanks in advance.
0
Comment
Question by:srinusimhadri
5 Comments
 
LVL 38

Expert Comment

by:yuzh
ID: 7170978
try to use:

   CTRL-v CTRL char,

   eg, for change to new page, type in:
       Ctrl v Ctrl L (hold ctrl and press v, hold ctrl press l)
       for CR:
       Ctrl v Ctrl m

       it depends on your UNIX favour.

0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 100 total points
ID: 7171210
CRLF: Ctrl-V Return Return
or:   Ctrl-V Ctrl-M Ctrl-V Ctrl-J
# depends on your stty settings
0
 

Author Comment

by:srinusimhadri
ID: 7171245
is there no way we can tell vi to use CRLF for line breaks ?
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7171338
depends on your vi version.
traditional AT&T vi does not produce useless characters (CR:-).
But most vi clones have a

     :set textmode

if not, you need to use the UNIX's prorietary unix2dos converter (the name varies on UNIX flaviours), or use a simple tr or perl command.
0
 
LVL 20

Expert Comment

by:tfewster
ID: 7921646
No comment has been added lately, so it's time to clean up this Topic Area.
I will leave a recommendation for this question in the Cleanup topic area as follows:

- Answered by ahoffmann

Please leave any comments here within the next 7 days

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

tfewster
Cleanup Volunteer
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Try to Setting up Static IP Address on Raspberry Pi 2 model B but get problems 7 100
Skill Development 15 176
unix example issues 18 90
Install MySQL 5.6 and PHP on Centos Linux 6 119
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question