Reputation: 49
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
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
Reputation: 311893
The easiest way would probably be to use the unix2dos
utility:
$ unix2dos myfile.txt
Upvotes: 3