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

1 Answer 1

:set ff=dos

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.

  • @Nouman if this answer works for you please remember to accept it with the tick mark on its left, next to the up/down voting buttons. May 26, 2018 at 8:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .