<?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 perl - remove last character off each line in file in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-remove-last-character-off-each-line-in-file/m-p/5000898#M424501</link>
    <description>How do I remove the last character off each line ( ^M ) in a file using perl</description>
    <pubDate>Fri, 01 Sep 2006 08:43:18 GMT</pubDate>
    <dc:creator>Ratzie</dc:creator>
    <dc:date>2006-09-01T08:43:18Z</dc:date>
    <item>
      <title>perl - remove last character off each line in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-remove-last-character-off-each-line-in-file/m-p/5000898#M424501</link>
      <description>How do I remove the last character off each line ( ^M ) in a file using perl</description>
      <pubDate>Fri, 01 Sep 2006 08:43:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-remove-last-character-off-each-line-in-file/m-p/5000898#M424501</guid>
      <dc:creator>Ratzie</dc:creator>
      <dc:date>2006-09-01T08:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: perl - remove last character off each line in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-remove-last-character-off-each-line-in-file/m-p/5000899#M424502</link>
      <description>perl -e's/.$//' file&lt;BR /&gt;perl -le's/\s+$//' file&lt;BR /&gt;&lt;BR /&gt;tr '\r' '' &lt;FILE&gt;&lt;/FILE&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Fri, 01 Sep 2006 08:46:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-remove-last-character-off-each-line-in-file/m-p/5000899#M424502</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2006-09-01T08:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: perl - remove last character off each line in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-remove-last-character-off-each-line-in-file/m-p/5000900#M424503</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;I think that our wizard (Merijn) hastely forgot to arm output:&lt;BR /&gt;&lt;BR /&gt;# perl -pe 's/.$//' file&lt;BR /&gt;&lt;BR /&gt;...or if you want to update the file "inplace" (and optionally keep a backup copy):&lt;BR /&gt;&lt;BR /&gt;# perl -pi.old -e 's/.$//' file&lt;BR /&gt;&lt;BR /&gt;...and thus you will have "file.old" as the pre-filtered copy.&lt;BR /&gt;&lt;BR /&gt;For DOS files with not only the carriage-retur (^M) but also an end-of-file "^Z", I use a variation like this:&lt;BR /&gt;&lt;BR /&gt;# perl -pe 's/\r\n/\n/;s/\032//' file&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 01 Sep 2006 09:53:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-remove-last-character-off-each-line-in-file/m-p/5000900#M424503</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-09-01T09:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: perl - remove last character off each line in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-remove-last-character-off-each-line-in-file/m-p/5000901#M424504</link>
      <description>You could also do one of the following:&lt;BR /&gt;&lt;BR /&gt;use dos2ux to create a new file with the ^M removed&lt;BR /&gt;&lt;BR /&gt;or use vi:&lt;BR /&gt;&lt;BR /&gt;:1,$s/[ctrl-V ctrl-M]//g&lt;BR /&gt;&lt;BR /&gt;where you see [ctrl-v ctrl-m] press control v then control m  &lt;BR /&gt;&lt;BR /&gt;the command will remove the ^M in the entire file</description>
      <pubDate>Fri, 01 Sep 2006 11:18:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-remove-last-character-off-each-line-in-file/m-p/5000901#M424504</guid>
      <dc:creator>Sean Dale</dc:creator>
      <dc:date>2006-09-01T11:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: perl - remove last character off each line in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-remove-last-character-off-each-line-in-file/m-p/5000902#M424505</link>
      <description>Appreciate the help</description>
      <pubDate>Fri, 01 Sep 2006 13:08:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-remove-last-character-off-each-line-in-file/m-p/5000902#M424505</guid>
      <dc:creator>Ratzie</dc:creator>
      <dc:date>2006-09-01T13:08:20Z</dc:date>
    </item>
  </channel>
</rss>

