3

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

Pramod Bhat
  • 49
  • 1
  • 6

3 Answers3

3

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

$ unix2dos myfile.txt
Mureinik
  • 297,002
  • 52
  • 306
  • 350
3

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

RishabhHardas
  • 495
  • 1
  • 5
  • 25
1

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.

xxor
  • 94
  • 3