• 30Jul

    If ^M character showing up in files while opening that file in vi editors use the following step to Convert ^M to new line character

    In vi use the following:

    :%s/^M/\n/g

    or with perl on the command line:

    $ perl -pi.bak -e ’s/^M/\n/g’

    NOTE: Be sure to create the ^M by typing ctrl+V followed by ctrl+M.

    ^M is ASCII 13 (Ctrl+M), which is the carriage return.

    Different operating systems use different symbols to set the end of a line/new line.
    Unix uses newline (\n)
    Mac uses carriage return (\r)
    And Windows/DOS use both (\n\r)

    To prevent the ^M from showing up in files, be sure to use ASCII (text) mode when transfering text files.

   

Recent Comments

  • This could be one of the reason why UK Government is making...
  • The root access in VPS gives you the ability to install and...
  • Hello...Thanks for the nice read, keep up the interesting po...
  • can i get more information..see not theoryitcal i need part...
  • Hi, I use a company laptop and its disabled. How can I enabl...