<?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 sed or awk challenge in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-or-awk-challenge/m-p/2613520#M884618</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have the following 'challenge':&lt;BR /&gt;- a 3rd party program reads the data in an ascii file until it finds a trailer record with the last word being "EOF".&lt;BR /&gt;- the program doesnot accept any characters or lines after this "EOF" marker. So the string EOF has to be followed by the actual EOF-code.&lt;BR /&gt;- The data for this file is spooled by the oracle utl_file package, so every written line in a text file is terminated with a line-feed/cariage return character. &lt;BR /&gt;- My question: does any one have a clue on how to replace the "EOF" string with the "EOF"string combined with the EOF character?? &lt;BR /&gt;thanx in advance...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 14 Nov 2001 11:44:32 GMT</pubDate>
    <dc:creator>Rene Krewinkel</dc:creator>
    <dc:date>2001-11-14T11:44:32Z</dc:date>
    <item>
      <title>sed or awk challenge</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-or-awk-challenge/m-p/2613520#M884618</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have the following 'challenge':&lt;BR /&gt;- a 3rd party program reads the data in an ascii file until it finds a trailer record with the last word being "EOF".&lt;BR /&gt;- the program doesnot accept any characters or lines after this "EOF" marker. So the string EOF has to be followed by the actual EOF-code.&lt;BR /&gt;- The data for this file is spooled by the oracle utl_file package, so every written line in a text file is terminated with a line-feed/cariage return character. &lt;BR /&gt;- My question: does any one have a clue on how to replace the "EOF" string with the "EOF"string combined with the EOF character?? &lt;BR /&gt;thanx in advance...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Nov 2001 11:44:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-or-awk-challenge/m-p/2613520#M884618</guid>
      <dc:creator>Rene Krewinkel</dc:creator>
      <dc:date>2001-11-14T11:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: sed or awk challenge</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-or-awk-challenge/m-p/2613521#M884619</link>
      <description>Hi Rene,&lt;BR /&gt;&lt;BR /&gt;So if your file, /tmp/abc, contains:&lt;BR /&gt;&lt;BR /&gt;this is a line&lt;BR /&gt;so is this&lt;BR /&gt;and this&lt;BR /&gt;this is the end EOF&lt;BR /&gt;should not get here&lt;BR /&gt;or here&lt;BR /&gt;&lt;BR /&gt;is this what you require?:&lt;BR /&gt;&lt;BR /&gt;awk '/EOF/{print;exit}{print}' /tmp/abc&lt;BR /&gt;this is a line&lt;BR /&gt;so is this&lt;BR /&gt;and this&lt;BR /&gt;this is the end EOF&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin.</description>
      <pubDate>Wed, 14 Nov 2001 11:51:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-or-awk-challenge/m-p/2613521#M884619</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2001-11-14T11:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: sed or awk challenge</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-or-awk-challenge/m-p/2613522#M884620</link>
      <description>There could only be one person to do that!&lt;BR /&gt;&lt;BR /&gt;you da man Robin!!&lt;BR /&gt;&lt;BR /&gt;Bill</description>
      <pubDate>Wed, 14 Nov 2001 11:55:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-or-awk-challenge/m-p/2613522#M884620</guid>
      <dc:creator>Bill McNAMARA_1</dc:creator>
      <dc:date>2001-11-14T11:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: sed or awk challenge</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-or-awk-challenge/m-p/2613523#M884621</link>
      <description>Sorry Robin, thanx for the reponse tough,&lt;BR /&gt;but if I transfer the file (binary or ascii) doesn't matter to a NT environment, there is still a new-line char after the EOF statement...</description>
      <pubDate>Wed, 14 Nov 2001 11:59:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-or-awk-challenge/m-p/2613523#M884621</guid>
      <dc:creator>Rene Krewinkel</dc:creator>
      <dc:date>2001-11-14T11:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: sed or awk challenge</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-or-awk-challenge/m-p/2613524#M884622</link>
      <description>Hi Rene,&lt;BR /&gt;&lt;BR /&gt;sorry, try this:&lt;BR /&gt;&lt;BR /&gt;awk '/EOF/{printf"%s",$0;exit}{print}' /tmp/abc&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin.</description>
      <pubDate>Wed, 14 Nov 2001 12:05:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-or-awk-challenge/m-p/2613524#M884622</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2001-11-14T12:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: sed or awk challenge</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-or-awk-challenge/m-p/2613525#M884623</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I'd suggest just a small change on Robin's solution.&lt;BR /&gt;&lt;BR /&gt;If you feed something like:&lt;BR /&gt;&lt;BR /&gt;this is a line&lt;BR /&gt;so is this&lt;BR /&gt;and this&lt;BR /&gt;this is a false EOF folks...&lt;BR /&gt;this is the end EOF&lt;BR /&gt;should not get here&lt;BR /&gt;&lt;BR /&gt;to the previous script, it will fail (EOF is there, but it is not the last word). A solution would be:&lt;BR /&gt;&lt;BR /&gt;awk '/EOF[ \t]*$/{printf"%s",$0;exit}{print}' &lt;BR /&gt;&lt;BR /&gt;Hope it helps,&lt;BR /&gt;Paga&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Nov 2001 16:51:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-or-awk-challenge/m-p/2613525#M884623</guid>
      <dc:creator>Marco Paganini</dc:creator>
      <dc:date>2001-11-14T16:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: sed or awk challenge</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-or-awk-challenge/m-p/2613526#M884624</link>
      <description>If you are moving the file from Unix to NT and then accessing it in NT I believe you will always have a new line character becuase of the way each operating system saves files.&lt;BR /&gt;&lt;BR /&gt;If you use vi to look at the file you see a ^M at the end of everyline. You can strip the control M on the Unix box if it came from NT.&lt;BR /&gt;However, I think you will have to have some kind of utility on the NT box that will give you an Unix shell to stripe the control M.&lt;BR /&gt;&lt;BR /&gt;on the Unix side you can do something like&lt;BR /&gt;&lt;BR /&gt;cat filename | sed 's/^M///g' &amp;gt; newfilename&lt;BR /&gt;&lt;BR /&gt;      the ^ is actually the control character not just a shift 6 you need to hit the control key.&lt;BR /&gt;&lt;BR /&gt;Let me know if this is what you are asking?</description>
      <pubDate>Thu, 15 Nov 2001 18:16:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-or-awk-challenge/m-p/2613526#M884624</guid>
      <dc:creator>Krishna Prasad</dc:creator>
      <dc:date>2001-11-15T18:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: sed or awk challenge</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-or-awk-challenge/m-p/2613527#M884625</link>
      <description>Thanx guy's,&lt;BR /&gt;&lt;BR /&gt;Marco's solution seems to do the trick after all. I MUST transfer the file binary though!&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;&lt;BR /&gt;Rene</description>
      <pubDate>Fri, 16 Nov 2001 08:29:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-or-awk-challenge/m-p/2613527#M884625</guid>
      <dc:creator>Rene Krewinkel</dc:creator>
      <dc:date>2001-11-16T08:29:01Z</dc:date>
    </item>
  </channel>
</rss>

