I have a text file which contains \n (0x0A) at the end of line, but as windows (notepad) take two characters i.e. \r\n (0x0D0A) to identify end of line therefor i want to substitute \n with these two characters \r\n.
Thank you
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this community:set ff=dos
:w
ff
/fileformat
is "unix" by default, but CRLF terminators are used when it is "dos". All line endings will be changed when the file is written back. See :help ff
for further caveats and corner cases.