wonnie wonnie - 1 year ago 98
Linux Question

How to add a carriage return as a character to a file?

I wanna have a string like:

blablbabla<carriage return goes here>

I mean the string should contain the carriage return. Is there any simple way to do it? Or if a write a program in c and use fputs with
, does this do the trick?

Answer Source

If you're using vim you can enter insert mode and type 'CTRL-v CTRL-m'. That ^M is the keyboard equivalent to \r. (see Insert the carriage return character in vim)

Inserting 0x0D in a hex editor will do the task.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download