Solved

Inserting a CRLF in VI

Posted on 2002-07-22
5
1,935 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 21

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

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

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

Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
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…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

626 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