<?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: replacing /n with newline with ed. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-n-with-newline-with-ed/m-p/2695363#M56526</link>
    <description>Hi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In ed or vi&lt;BR /&gt;&lt;BR /&gt;type ControlVEnter which will show ^M&lt;BR /&gt;&lt;BR /&gt;This is a new line.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;     Steve Steel</description>
    <pubDate>Tue, 02 Apr 2002 14:20:24 GMT</pubDate>
    <dc:creator>Steve Steel</dc:creator>
    <dc:date>2002-04-02T14:20:24Z</dc:date>
    <item>
      <title>replacing /n with newline with ed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-n-with-newline-with-ed/m-p/2695362#M56525</link>
      <description>I am trying to replace a string in a file "/n" with a carriage return.  the man page on ed uses the following example:&lt;BR /&gt;cat - &amp;lt;&amp;lt; EOF | ed -s file-1 &lt;BR /&gt;1,$ s/abc/xyz/ &lt;BR /&gt;w file-2 &lt;BR /&gt;q &lt;BR /&gt;EOF &lt;BR /&gt;&lt;BR /&gt;how do i specify that i want to replace with a newline?&lt;BR /&gt;&lt;BR /&gt;I've tried&lt;BR /&gt;cat - &amp;lt;&amp;lt; EOF | ed -s file-1 &lt;BR /&gt;1,$ s/\n/\r/g &lt;BR /&gt;w file-2 &lt;BR /&gt;q &lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;but that replaces the \n with the \r.</description>
      <pubDate>Tue, 02 Apr 2002 14:11:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-n-with-newline-with-ed/m-p/2695362#M56525</guid>
      <dc:creator>Jonathan Corbeill</dc:creator>
      <dc:date>2002-04-02T14:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: replacing /n with newline with ed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-n-with-newline-with-ed/m-p/2695363#M56526</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In ed or vi&lt;BR /&gt;&lt;BR /&gt;type ControlVEnter which will show ^M&lt;BR /&gt;&lt;BR /&gt;This is a new line.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;     Steve Steel</description>
      <pubDate>Tue, 02 Apr 2002 14:20:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-n-with-newline-with-ed/m-p/2695363#M56526</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2002-04-02T14:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: replacing /n with newline with ed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-n-with-newline-with-ed/m-p/2695364#M56527</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;By enter I mean the return key&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Or type ControlVControlM&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;          Steve Steel</description>
      <pubDate>Tue, 02 Apr 2002 14:22:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-n-with-newline-with-ed/m-p/2695364#M56527</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2002-04-02T14:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: replacing /n with newline with ed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-n-with-newline-with-ed/m-p/2695365#M56528</link>
      <description>Hi Jonathan,&lt;BR /&gt;&lt;BR /&gt;Under the context of the ed command you're trying you'll need to "escape" the slash just before the "r" that represents the carriage return.&lt;BR /&gt;&lt;BR /&gt;So use double slash:&lt;BR /&gt;&lt;BR /&gt;\and press return to change line (then you just finnish the line).&lt;BR /&gt;&lt;BR /&gt;Instead of:&lt;BR /&gt;&lt;BR /&gt;\n&lt;BR /&gt;&lt;BR /&gt;Good Luck,&lt;BR /&gt;&lt;BR /&gt;Rumagoso</description>
      <pubDate>Tue, 02 Apr 2002 14:26:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-n-with-newline-with-ed/m-p/2695365#M56528</guid>
      <dc:creator>Rui Soares</dc:creator>
      <dc:date>2002-04-02T14:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: replacing /n with newline with ed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-n-with-newline-with-ed/m-p/2695366#M56529</link>
      <description>Oops,&lt;BR /&gt;&lt;BR /&gt;my post was victim of escaping!!!!&lt;BR /&gt;You should have seen:&lt;BR /&gt;\\that is double-slash instead of \\and&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 02 Apr 2002 14:30:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-n-with-newline-with-ed/m-p/2695366#M56529</guid>
      <dc:creator>Rui Soares</dc:creator>
      <dc:date>2002-04-02T14:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: replacing /n with newline with ed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-n-with-newline-with-ed/m-p/2695367#M56530</link>
      <description>Great input guys,&lt;BR /&gt;I'm almost there...&lt;BR /&gt;&lt;BR /&gt;My current command looks like this:&lt;BR /&gt;&lt;BR /&gt;cat - &amp;lt;&amp;lt; EOF | ed -s work.txt&lt;BR /&gt;1,$ s/&lt;BACKSLASH&gt;&lt;BACKSLASH&gt;n/^M/g&lt;BR /&gt;w work2.txt&lt;BR /&gt;q&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;all occurences of the letter n are replaced with carriage returns.  Thats mostly what I want but the backslash stays in the file.  How do I say that i want the backslash and the n to be replaced?&lt;/BACKSLASH&gt;&lt;/BACKSLASH&gt;</description>
      <pubDate>Tue, 02 Apr 2002 14:38:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-n-with-newline-with-ed/m-p/2695367#M56530</guid>
      <dc:creator>Jonathan Corbeill</dc:creator>
      <dc:date>2002-04-02T14:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: replacing /n with newline with ed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-n-with-newline-with-ed/m-p/2695368#M56531</link>
      <description>Instead of using editor commands, you can also use a oneliner script:&lt;BR /&gt;&lt;BR /&gt;awk 'BEGIN{FS="/n"}{&lt;BR /&gt; for (i=1;i&amp;lt;=NF;i++){&lt;BR /&gt;   printf "%s\n",$i^J }&lt;BR /&gt;   printf "\n";&lt;BR /&gt;   }' infile &amp;gt; uitfile&lt;BR /&gt;&lt;BR /&gt;FS is the fieldseperator to be replaced by 'n.&lt;BR /&gt;I tried it for multiple lines and works just fine.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Ceesjan</description>
      <pubDate>Tue, 02 Apr 2002 14:45:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-n-with-newline-with-ed/m-p/2695368#M56531</guid>
      <dc:creator>Ceesjan van Hattum</dc:creator>
      <dc:date>2002-04-02T14:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: replacing /n with newline with ed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-n-with-newline-with-ed/m-p/2695369#M56532</link>
      <description>How about a sed version:&lt;BR /&gt;&lt;BR /&gt;sed 's,/n,,g' file-1 &amp;gt;file-2&lt;BR /&gt;&lt;BR /&gt;This can be entered from command line or in a script.  Note it really is 2 lines (the first ending with "\").&lt;BR /&gt;&lt;BR /&gt;Darrell&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 02 Apr 2002 15:49:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-n-with-newline-with-ed/m-p/2695369#M56532</guid>
      <dc:creator>Darrell Allen</dc:creator>
      <dc:date>2002-04-02T15:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: replacing /n with newline with ed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-n-with-newline-with-ed/m-p/2695370#M56533</link>
      <description>Okay, it didn't post correctly.  Let's try again.&lt;BR /&gt;&lt;BR /&gt;sed 's,/n,&lt;BR /&gt;,g' file-1 &amp;gt;file-2&lt;BR /&gt;&lt;BR /&gt;Darrell&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 02 Apr 2002 15:50:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-n-with-newline-with-ed/m-p/2695370#M56533</guid>
      <dc:creator>Darrell Allen</dc:creator>
      <dc:date>2002-04-02T15:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: replacing /n with newline with ed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-n-with-newline-with-ed/m-p/2695371#M56534</link>
      <description>It still didn't post correctly.  There is supposed to be a "\" at the end of the first line.&lt;BR /&gt;&lt;BR /&gt;Let's try it as an attachment.&lt;BR /&gt;&lt;BR /&gt;Darrell&lt;BR /&gt;</description>
      <pubDate>Tue, 02 Apr 2002 15:53:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-n-with-newline-with-ed/m-p/2695371#M56534</guid>
      <dc:creator>Darrell Allen</dc:creator>
      <dc:date>2002-04-02T15:53:54Z</dc:date>
    </item>
  </channel>
</rss>

