<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Why does ^M appears at the end of the line? in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/why-does-m-appears-at-the-end-of-the-line/m-p/3760231#M101787</link>
    <description>Hi Guys,&lt;BR /&gt;&lt;BR /&gt;  I notice the symbol "^M" appearing at the end of each line in my text file. What does it means? How can I get rid or prevent it from appearing? is there any implication if I remove them?&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Henry&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 28 Mar 2006 05:45:32 GMT</pubDate>
    <dc:creator>Henry Chua</dc:creator>
    <dc:date>2006-03-28T05:45:32Z</dc:date>
    <item>
      <title>Why does ^M appears at the end of the line?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/why-does-m-appears-at-the-end-of-the-line/m-p/3760231#M101787</link>
      <description>Hi Guys,&lt;BR /&gt;&lt;BR /&gt;  I notice the symbol "^M" appearing at the end of each line in my text file. What does it means? How can I get rid or prevent it from appearing? is there any implication if I remove them?&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Henry&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 28 Mar 2006 05:45:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/why-does-m-appears-at-the-end-of-the-line/m-p/3760231#M101787</guid>
      <dc:creator>Henry Chua</dc:creator>
      <dc:date>2006-03-28T05:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: Why does ^M appears at the end of the line?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/why-does-m-appears-at-the-end-of-the-line/m-p/3760232#M101788</link>
      <description>^M is a character will be inserted when moving dos file to unix system. To remove that,&lt;BR /&gt;&lt;BR /&gt;# dos2ux &lt;FILENAME&gt;&lt;BR /&gt;&lt;BR /&gt;will do that.&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;Muthu&lt;/FILENAME&gt;</description>
      <pubDate>Tue, 28 Mar 2006 05:47:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/why-does-m-appears-at-the-end-of-the-line/m-p/3760232#M101788</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2006-03-28T05:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Why does ^M appears at the end of the line?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/why-does-m-appears-at-the-end-of-the-line/m-p/3760233#M101789</link>
      <description>More good ways:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=972302" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=972302&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=364956" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=364956&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;Muthu</description>
      <pubDate>Tue, 28 Mar 2006 05:49:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/why-does-m-appears-at-the-end-of-the-line/m-p/3760233#M101789</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2006-03-28T05:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Why does ^M appears at the end of the line?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/why-does-m-appears-at-the-end-of-the-line/m-p/3760234#M101790</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Did you ftp the file to your server?&lt;BR /&gt;Change the transfer mode from ascii to binary to solve this problem&lt;BR /&gt;&lt;BR /&gt;ftp&amp;gt;bin&lt;BR /&gt;</description>
      <pubDate>Tue, 28 Mar 2006 05:50:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/why-does-m-appears-at-the-end-of-the-line/m-p/3760234#M101790</guid>
      <dc:creator>Luk Vandenbussche</dc:creator>
      <dc:date>2006-03-28T05:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: Why does ^M appears at the end of the line?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/why-does-m-appears-at-the-end-of-the-line/m-p/3760235#M101791</link>
      <description>Henry,&lt;BR /&gt;the ^M is the way the system shows the difference in how UNIX systems and DOS systems interpret the carriage return at the end of the line.&lt;BR /&gt;Solutions as to how to remove/prevent the character are aplenty (see earlier answers).</description>
      <pubDate>Tue, 28 Mar 2006 05:59:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/why-does-m-appears-at-the-end-of-the-line/m-p/3760235#M101791</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-03-28T05:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: Why does ^M appears at the end of the line?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/why-does-m-appears-at-the-end-of-the-line/m-p/3760236#M101792</link>
      <description>Luk,&lt;BR /&gt;&lt;BR /&gt;I think the mode needs to be set to ascii when ftping file from DOS to Unix so that the ^M characters are interpreted by Unix as carriage return and do not appear as ^M in the files in UNIX, whereas if you use binary mode the file is ftpied in binary format and Unix does not do any interpretation of any of the characters.&lt;BR /&gt;So ascii is the mode required.&lt;BR /&gt;&lt;BR /&gt;Henry,&lt;BR /&gt;Next - if you wish to remove the ^M characters from the file you have already got - edit the file using vi, then type the colon - : to go to command mode in vi and give following at colon prompt&lt;BR /&gt;s/^M//g&lt;BR /&gt;This will remove all the ^M characters .(Note to type the correct ^M character - use the following sequence of keys&lt;BR /&gt;Ctrl+V+Shift+M  -  the Ctrl+V will give you the control character ^  and shit+M will give the M)&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Ninad&lt;BR /&gt;</description>
      <pubDate>Tue, 28 Mar 2006 07:15:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/why-does-m-appears-at-the-end-of-the-line/m-p/3760236#M101792</guid>
      <dc:creator>Ninad_1</dc:creator>
      <dc:date>2006-03-28T07:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: Why does ^M appears at the end of the line?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/why-does-m-appears-at-the-end-of-the-line/m-p/3760237#M101793</link>
      <description>Sorry Muthu,&lt;BR /&gt;it's&lt;BR /&gt;dos2ux file.name &amp;gt; new_file.name&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;Volkmar&lt;BR /&gt;</description>
      <pubDate>Tue, 28 Mar 2006 07:56:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/why-does-m-appears-at-the-end-of-the-line/m-p/3760237#M101793</guid>
      <dc:creator>V. Nyga</dc:creator>
      <dc:date>2006-03-28T07:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: Why does ^M appears at the end of the line?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/why-does-m-appears-at-the-end-of-the-line/m-p/3760238#M101794</link>
      <description>Hi Henry:&lt;BR /&gt;&lt;BR /&gt;As noted, if you are running on HP-UX you have 'dos2ux' and 'ux2dos'.&lt;BR /&gt;&lt;BR /&gt;The 'dos2ux' and 'ux2dos' commands read each specified file in sequence and write them to standard output, converting from DOS to UNIX format or from UNIX to DOS format, respectively.&lt;BR /&gt;&lt;BR /&gt;If you are *not* on a HP server, you can make strip the carriage returns (^M) with this:&lt;BR /&gt;&lt;BR /&gt;# perl -ni.old -e ' s,\015\012,\012,s; s,\032,,s; file &lt;BR /&gt;&lt;BR /&gt;The above make a backup copy of "file" as "file.old" and performs the conversion.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 28 Mar 2006 20:24:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/why-does-m-appears-at-the-end-of-the-line/m-p/3760238#M101794</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-03-28T20:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: Why does ^M appears at the end of the line?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/why-does-m-appears-at-the-end-of-the-line/m-p/3760239#M101795</link>
      <description>^M is the representation of the control character encoded by ASCII code 13.  DOS systems use this control code (13) to represent a carriage return.&lt;BR /&gt;&lt;BR /&gt;You generally get this when performing an FTP 'get' or 'put' of a file and you have not selected the proper file transfer mode.&lt;BR /&gt;&lt;BR /&gt;When transferring files from Unix to DOS (Windows) systems and those files are text files, you may wish to manually set the file transfer mode to 'ascii'.  That way, the carriage returns and line feed characters will be cleaned up during the FTP transfer.&lt;BR /&gt;&lt;BR /&gt;If you forget (or get confused by all this nonsense), then just use the utility specified in another post (dos2ux) or you can use a vi command, if you are comfortable with that:&lt;BR /&gt;&lt;BR /&gt;[ESC]:%s/[Ctrl-V][Ctrl-M]$//&lt;BR /&gt;&lt;BR /&gt;This command says: for all lines in the file (%), substitute (s), the first pattern (the sequence ctrl-v,ctrl-m is how you get Ctrl-M in vi) -- only when it appears at the end of a record ($), with the second pattern (null).&lt;BR /&gt;&lt;BR /&gt;--Good luck, Jeff</description>
      <pubDate>Tue, 28 Mar 2006 21:13:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/why-does-m-appears-at-the-end-of-the-line/m-p/3760239#M101795</guid>
      <dc:creator>Jeffrey L. Cooke</dc:creator>
      <dc:date>2006-03-28T21:13:01Z</dc:date>
    </item>
  </channel>
</rss>

