Solved

Inserting a CRLF in VI

Posted on 2002-07-22
5
1,862 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
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.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

828 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