<?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 Re: Delete control M character using tr command. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-control-m-character-using-tr-command/m-p/3869037#M773318</link>
    <description>Thanks all...&lt;BR /&gt;&lt;BR /&gt;i just left  '&amp;lt;'  before test.dat &lt;BR /&gt;tr -d '\r' test.dat &amp;gt; test1.dat&lt;BR /&gt;&lt;BR /&gt;tr -d '\r' &amp;lt; test.dat &amp;gt; test1.dat&lt;BR /&gt;this worked for me...&lt;BR /&gt;&lt;BR /&gt;Thanks again.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 25 Sep 2006 12:01:54 GMT</pubDate>
    <dc:creator>uform</dc:creator>
    <dc:date>2006-09-25T12:01:54Z</dc:date>
    <item>
      <title>Delete control M character using tr command.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-control-m-character-using-tr-command/m-p/3869031#M773312</link>
      <description>1) How to do it ? following is not working for me ..&lt;BR /&gt;&lt;BR /&gt;tr -d '\r' test.dat  &amp;gt; test1.dat&lt;BR /&gt;&lt;BR /&gt;2) How to get only the records which has control M in it ? &lt;BR /&gt;</description>
      <pubDate>Mon, 25 Sep 2006 10:02:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-control-m-character-using-tr-command/m-p/3869031#M773312</guid>
      <dc:creator>uform</dc:creator>
      <dc:date>2006-09-25T10:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: Delete control M character using tr command.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-control-m-character-using-tr-command/m-p/3869032#M773313</link>
      <description>The simpler way would be to use the dos2ux command.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Mon, 25 Sep 2006 10:06:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-control-m-character-using-tr-command/m-p/3869032#M773313</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2006-09-25T10:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: Delete control M character using tr command.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-control-m-character-using-tr-command/m-p/3869033#M773314</link>
      <description>you edit file with vi and do the following after pressing "Esc" key.&lt;BR /&gt;&lt;BR /&gt;:%s/&lt;CTRL-V&gt;&lt;CTRL-M&gt;//g&lt;BR /&gt;&lt;BR /&gt;it will remove all ^M character in that file.&lt;/CTRL-M&gt;&lt;/CTRL-V&gt;</description>
      <pubDate>Mon, 25 Sep 2006 10:06:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-control-m-character-using-tr-command/m-p/3869033#M773314</guid>
      <dc:creator>IT_2007</dc:creator>
      <dc:date>2006-09-25T10:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: Delete control M character using tr command.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-control-m-character-using-tr-command/m-p/3869034#M773315</link>
      <description>Hi,&lt;BR /&gt;how about:&lt;BR /&gt;tr -d "\015" &amp;lt; test.dat &amp;gt; test1.dat&lt;BR /&gt;&lt;BR /&gt;Don't forget, to get the ^M in UNIX command you have to use CTRL+V CTRL+M.&lt;BR /&gt;</description>
      <pubDate>Mon, 25 Sep 2006 10:08:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-control-m-character-using-tr-command/m-p/3869034#M773315</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-09-25T10:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: Delete control M character using tr command.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-control-m-character-using-tr-command/m-p/3869035#M773316</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Yet another way is:&lt;BR /&gt;&lt;BR /&gt;# perl -pe 's/\r\n/\n/;s/\032//' file&lt;BR /&gt;&lt;BR /&gt;This handles not only carriage-return characters (^M) but also any end-of-file character (^Z).&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 25 Sep 2006 10:31:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-control-m-character-using-tr-command/m-p/3869035#M773316</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-09-25T10:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: Delete control M character using tr command.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-control-m-character-using-tr-command/m-p/3869036#M773317</link>
      <description>You simply need to redirect your stdin from the file with the superfluous CRs as Peter showed you.&lt;BR /&gt;Unlike its bigger brother sed the tr command requires this.</description>
      <pubDate>Mon, 25 Sep 2006 11:19:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-control-m-character-using-tr-command/m-p/3869036#M773317</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2006-09-25T11:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Delete control M character using tr command.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-control-m-character-using-tr-command/m-p/3869037#M773318</link>
      <description>Thanks all...&lt;BR /&gt;&lt;BR /&gt;i just left  '&amp;lt;'  before test.dat &lt;BR /&gt;tr -d '\r' test.dat &amp;gt; test1.dat&lt;BR /&gt;&lt;BR /&gt;tr -d '\r' &amp;lt; test.dat &amp;gt; test1.dat&lt;BR /&gt;this worked for me...&lt;BR /&gt;&lt;BR /&gt;Thanks again.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 25 Sep 2006 12:01:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-control-m-character-using-tr-command/m-p/3869037#M773318</guid>
      <dc:creator>uform</dc:creator>
      <dc:date>2006-09-25T12:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: Delete control M character using tr command.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-control-m-character-using-tr-command/m-p/3869038#M773319</link>
      <description>You can also use the col command:&lt;BR /&gt;&lt;BR /&gt;cat test.dat |col -b &amp;gt; test.dat.1&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;col -bx test.dat test.dat.1&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Mon, 25 Sep 2006 12:19:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-control-m-character-using-tr-command/m-p/3869038#M773319</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2006-09-25T12:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Delete control M character using tr command.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-control-m-character-using-tr-command/m-p/3869039#M773320</link>
      <description>Actually, you just need to transfer the files correctly. CTRL-M is a PC artifact. Or more accurately, you are transferring a file from a very different computer without proper translation. If you used FTP, you need to set the ASCII translator for these files. Note that BINARY does no translation so you get the file as it appears inside the PC -- which is not compatible with Unix (Unix uses LF for end-of-line, PCs use CR+LF, other systems use other characters). Every line has CTRL-M at the end but FTP knows how to convert between different systems.&lt;BR /&gt; &lt;BR /&gt;Now if you are sharing directories between dissimilar systems, the same rule holds true. The PC files appear exactly as they exist on each system. A Unix file will have black squares at the end-of-line when viewed in Notepad, and a PC file will have CTRL-M's when viewed in Unix.&lt;BR /&gt; &lt;BR /&gt;What to do? Well, there's no way to get t5he two different OS's to change so you'll have to translate whichever way you need. The 2 commands are:&lt;BR /&gt; &lt;BR /&gt;dos2ux&lt;BR /&gt;and&lt;BR /&gt;ux2dos&lt;BR /&gt; &lt;BR /&gt;(there's no similar commands on a PC).</description>
      <pubDate>Mon, 25 Sep 2006 18:21:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-control-m-character-using-tr-command/m-p/3869039#M773320</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2006-09-25T18:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: Delete control M character using tr command.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-control-m-character-using-tr-command/m-p/3869040#M773321</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;To add to Bill's comments, while 'dos2ux' and 'ux2dos' are UNIX commands, Perl runs on virtually any platform.  Hence on a UNIX or on a Microsoft Windows server the following are true:&lt;BR /&gt;&lt;BR /&gt;In lieu of 'dos2ux' use:&lt;BR /&gt;&lt;BR /&gt;# perl -pe 's!\r\n!\n!;s!\032!! if eof' file&lt;BR /&gt;&lt;BR /&gt;...and in lieu of 'ux2dos' use:&lt;BR /&gt;&lt;BR /&gt;# perl -pe 's!\n!\r\n!s;END{print "\032"}' file&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 25 Sep 2006 19:13:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-control-m-character-using-tr-command/m-p/3869040#M773321</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-09-25T19:13:38Z</dc:date>
    </item>
  </channel>
</rss>

