<?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: replace control characters in a file in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089701#M442162</link>
    <description>&lt;BR /&gt;Hmmm, why not dos2ux?&lt;BR /&gt;Are those carriage returns in the missle of the lines?&lt;BR /&gt;&lt;BR /&gt;Anyway, in vi you can use&lt;BR /&gt;:1,$s/^M//&lt;BR /&gt;&lt;BR /&gt;That ^M must be entered as control-V control-M&lt;BR /&gt;&lt;BR /&gt;hth,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
    <pubDate>Fri, 25 Jan 2008 16:25:51 GMT</pubDate>
    <dc:creator>Hein van den Heuvel</dc:creator>
    <dc:date>2008-01-25T16:25:51Z</dc:date>
    <item>
      <title>replace control characters in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089693#M442154</link>
      <description>does anybody now the vi command to remove a lot of ^M's in a large file and replace them with nothing ?</description>
      <pubDate>Fri, 25 Jan 2008 15:46:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089693#M442154</guid>
      <dc:creator>Mark Smith T-Systems</dc:creator>
      <dc:date>2008-01-25T15:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: replace control characters in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089694#M442155</link>
      <description>Hi Mark,&lt;BR /&gt;&lt;BR /&gt;You can use the dos2ux command, have a look at the man page.&lt;BR /&gt;&lt;BR /&gt;# dos2ux old_name &amp;gt; new_name&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Robert-Jan</description>
      <pubDate>Fri, 25 Jan 2008 16:06:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089694#M442155</guid>
      <dc:creator>Robert-Jan Goossens_1</dc:creator>
      <dc:date>2008-01-25T16:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: replace control characters in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089695#M442156</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;Try to use dos2ux command.&lt;BR /&gt;&lt;BR /&gt;#dos2ux file &amp;gt; newfile.&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Fri, 25 Jan 2008 16:07:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089695#M442156</guid>
      <dc:creator>LucianoCarvalho</dc:creator>
      <dc:date>2008-01-25T16:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: replace control characters in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089696#M442157</link>
      <description>Hi Mark:&lt;BR /&gt;&lt;BR /&gt;You can do:&lt;BR /&gt;&lt;BR /&gt;# dos2ux file&lt;BR /&gt;&lt;BR /&gt;# perl -pe 's%\r\n%\n%; s%\032%% if eof' file&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 25 Jan 2008 16:08:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089696#M442157</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-01-25T16:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: replace control characters in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089697#M442158</link>
      <description>sounds like the file got ftp'd from Windows (or saved from Windows on a CIFS share)&lt;BR /&gt;&lt;BR /&gt;dos2ux badfile &amp;gt; newfile&lt;BR /&gt;&lt;BR /&gt;or in vi&lt;BR /&gt;s/$^V^M/g</description>
      <pubDate>Fri, 25 Jan 2008 16:08:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089697#M442158</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2008-01-25T16:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: replace control characters in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089698#M442159</link>
      <description>I would like to do this within vi if possible, the last reply doesnt seem to work</description>
      <pubDate>Fri, 25 Jan 2008 16:16:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089698#M442159</guid>
      <dc:creator>Mark Smith T-Systems</dc:creator>
      <dc:date>2008-01-25T16:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: replace control characters in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089699#M442160</link>
      <description>&lt;BR /&gt;Try this in vi.&lt;BR /&gt;&lt;BR /&gt;:%s/^V^M//g&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 25 Jan 2008 16:21:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089699#M442160</guid>
      <dc:creator>LucianoCarvalho</dc:creator>
      <dc:date>2008-01-25T16:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: replace control characters in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089700#M442161</link>
      <description>I forgot to mention.&lt;BR /&gt;The ^V character is just for vi let you to type ^M command.  The final command result in vi will lok like ":%s/^M//g"&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Fri, 25 Jan 2008 16:25:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089700#M442161</guid>
      <dc:creator>LucianoCarvalho</dc:creator>
      <dc:date>2008-01-25T16:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: replace control characters in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089701#M442162</link>
      <description>&lt;BR /&gt;Hmmm, why not dos2ux?&lt;BR /&gt;Are those carriage returns in the missle of the lines?&lt;BR /&gt;&lt;BR /&gt;Anyway, in vi you can use&lt;BR /&gt;:1,$s/^M//&lt;BR /&gt;&lt;BR /&gt;That ^M must be entered as control-V control-M&lt;BR /&gt;&lt;BR /&gt;hth,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Fri, 25 Jan 2008 16:25:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089701#M442162</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2008-01-25T16:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: replace control characters in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089702#M442163</link>
      <description>Oops, &lt;BR /&gt;&lt;BR /&gt;If there is more than 1 ^M on any line, then you'd need to add the 'g' at the end of the substitute command of course:&lt;BR /&gt;&lt;BR /&gt;:1,$s/^M//g&lt;BR /&gt;&lt;BR /&gt;That ^M must still be entered as control-V control-M&lt;BR /&gt;&lt;BR /&gt;hth,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Fri, 25 Jan 2008 16:29:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089702#M442163</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2008-01-25T16:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: replace control characters in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089703#M442164</link>
      <description>sorry....didn't explain it well</description>
      <pubDate>Fri, 25 Jan 2008 16:31:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089703#M442164</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2008-01-25T16:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: replace control characters in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089704#M442165</link>
      <description>sorry, didn't explain it well.&lt;BR /&gt;&lt;BR /&gt;assuming the ones you want are at the end of the line, you want&lt;BR /&gt;&lt;BR /&gt;1,$s/cntrl-Vcntrl-M$//g &lt;BR /&gt;&lt;BR /&gt;the Cntrl-V "escapes" the Cntrl-M so it's taken as a literal, and the "$" in the pattern is an anchor for the end-of-line</description>
      <pubDate>Fri, 25 Jan 2008 16:37:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089704#M442165</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2008-01-25T16:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: replace control characters in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089705#M442166</link>
      <description>I am getting other characters in the file besides the ^M that shouldnt be there, the dos2ux takes out the ^M but not the others, I think the problem may be in the way the file was ftp transfered.</description>
      <pubDate>Fri, 25 Jan 2008 16:50:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089705#M442166</guid>
      <dc:creator>Mark Smith T-Systems</dc:creator>
      <dc:date>2008-01-25T16:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: replace control characters in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089706#M442167</link>
      <description>what kind of characters are you seeing that don't belong? &lt;BR /&gt;&lt;BR /&gt;such things as Ctrl-L (form-feed) are retained for printing page breaks, which you may still want.&lt;BR /&gt;&lt;BR /&gt;usually what happens is a file is created in Windows as text.  Transferring this file in binary mode to a Unix box results in the Windows-style CR/LF pairs being retained, while an ascii-mode transfer translates them.  &lt;BR /&gt;&lt;BR /&gt;Without knowing what the file contains / how created, I would hesitate to alter it further.</description>
      <pubDate>Fri, 25 Jan 2008 16:54:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089706#M442167</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2008-01-25T16:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: replace control characters in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089707#M442168</link>
      <description>OldSchool&lt;BR /&gt;&lt;BR /&gt;I got the ^M's out now butv it is putting this in:&lt;BR /&gt;&lt;BR /&gt;if sum -r &amp;lt;/dev/null &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;instead of:&lt;BR /&gt;if sum -r /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and I assume other lines are probably&lt;BR /&gt;corrupt like that too.</description>
      <pubDate>Fri, 25 Jan 2008 17:06:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089707#M442168</guid>
      <dc:creator>Mark Smith T-Systems</dc:creator>
      <dc:date>2008-01-25T17:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: replace control characters in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089708#M442169</link>
      <description>there are other problems with this patch i downloaded, thanks fo r all of your assistance.</description>
      <pubDate>Fri, 25 Jan 2008 17:16:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089708#M442169</guid>
      <dc:creator>Mark Smith T-Systems</dc:creator>
      <dc:date>2008-01-25T17:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: replace control characters in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089709#M442170</link>
      <description>&amp;gt;I got the ^M's out now but it is putting this in:&lt;BR /&gt;if sum -r &amp;lt;/dev/null &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;These are html formatting chars.  You might want to use the right button to save the patch directly?</description>
      <pubDate>Sat, 26 Jan 2008 10:56:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089709#M442170</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-01-26T10:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: replace control characters in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089710#M442171</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Can you please let me know how to solve this issue.Currently i am facing same problem all of a sudden after server reboot .I am using CIFS/Samba to map my unix folders to windows.&lt;BR /&gt;&lt;BR /&gt;TIA&lt;BR /&gt;Sri</description>
      <pubDate>Tue, 15 Apr 2008 21:51:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-control-characters-in-a-file/m-p/5089710#M442171</guid>
      <dc:creator>Muthyala</dc:creator>
      <dc:date>2008-04-15T21:51:31Z</dc:date>
    </item>
  </channel>
</rss>

