Pramod Bhat
Pramod Bhat

Reputation: 49

Add Control M character in a text file

Hi I am trying to add Control M character in a text file using Putty. I tried to do Ctrl-v Ctrl-M but as soon as I do this it goes out of putty to my desktop home.Can anyone please tell me how to add Ctrl M character in a file

Upvotes: 3

Views: 4200

Answers (3)

xxor
xxor

Reputation: 157

In Vim, in the insert mode, Ctrl-V x##, where ## is the hex code of the character. In case of Ctrl-M the combination is Ctrl-V x0d. You can see the hex value of a character under cursor if you type :as command.

Upvotes: 1

RishabhHardas
RishabhHardas

Reputation: 525

In vim in the insert mode and type CTRL-v CTRL-m.

Upvotes: 4

Mureinik
Mureinik

Reputation: 311893

The easiest way would probably be to use the unix2dos utility:

$ unix2dos myfile.txt

Upvotes: 3

Related Questions