<?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 Scripting question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2705197#M902809</link>
    <description>I have few files which is generated every week it has few duplicate entries in it.&lt;BR /&gt;&lt;BR /&gt;Is it possible to do something like this&lt;BR /&gt;&lt;BR /&gt;input file :&lt;BR /&gt;&lt;BR /&gt;EXPZ_84940&lt;BR /&gt;KJAD_02938&lt;BR /&gt;KJAD_02938&lt;BR /&gt;NJSK_77490&lt;BR /&gt;....&lt;BR /&gt;&lt;BR /&gt;output file:&lt;BR /&gt;EXPZ_84940&lt;BR /&gt;KJAD_02938 KJAD_02938&lt;BR /&gt;NJSK_77490&lt;BR /&gt;....&lt;BR /&gt;&lt;BR /&gt;so that all the matching ones are beside each other.&lt;BR /&gt;&lt;BR /&gt;Thanks for your time and help.&lt;BR /&gt;</description>
    <pubDate>Wed, 17 Apr 2002 12:22:06 GMT</pubDate>
    <dc:creator>John McDen</dc:creator>
    <dc:date>2002-04-17T12:22:06Z</dc:date>
    <item>
      <title>Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2705197#M902809</link>
      <description>I have few files which is generated every week it has few duplicate entries in it.&lt;BR /&gt;&lt;BR /&gt;Is it possible to do something like this&lt;BR /&gt;&lt;BR /&gt;input file :&lt;BR /&gt;&lt;BR /&gt;EXPZ_84940&lt;BR /&gt;KJAD_02938&lt;BR /&gt;KJAD_02938&lt;BR /&gt;NJSK_77490&lt;BR /&gt;....&lt;BR /&gt;&lt;BR /&gt;output file:&lt;BR /&gt;EXPZ_84940&lt;BR /&gt;KJAD_02938 KJAD_02938&lt;BR /&gt;NJSK_77490&lt;BR /&gt;....&lt;BR /&gt;&lt;BR /&gt;so that all the matching ones are beside each other.&lt;BR /&gt;&lt;BR /&gt;Thanks for your time and help.&lt;BR /&gt;</description>
      <pubDate>Wed, 17 Apr 2002 12:22:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2705197#M902809</guid>
      <dc:creator>John McDen</dc:creator>
      <dc:date>2002-04-17T12:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2705198#M902810</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Try&lt;BR /&gt;&lt;BR /&gt;Cat file | sort &amp;gt; newfile&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Paula</description>
      <pubDate>Wed, 17 Apr 2002 12:26:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2705198#M902810</guid>
      <dc:creator>Paula J Frazer-Campbell</dc:creator>
      <dc:date>2002-04-17T12:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2705199#M902811</link>
      <description>Hi Paula,&lt;BR /&gt;&lt;BR /&gt;That will only sort the files I have the files sorted but I need it to place the duplicate entry next to each other in the same line, like in the output.&lt;BR /&gt;&lt;BR /&gt;Thanks for your help.</description>
      <pubDate>Wed, 17 Apr 2002 12:32:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2705199#M902811</guid>
      <dc:creator>John McDen</dc:creator>
      <dc:date>2002-04-17T12:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2705200#M902812</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;uniq will do that for you:&lt;BR /&gt;&lt;BR /&gt;uniq file &amp;gt; newfile&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Wed, 17 Apr 2002 12:34:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2705200#M902812</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2002-04-17T12:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2705201#M902813</link>
      <description>Hi again,&lt;BR /&gt;&lt;BR /&gt;sorry i haven't read your question exactly.&lt;BR /&gt;Here my little awk script for your job:&lt;BR /&gt;&lt;BR /&gt;awk 'BEGIN{p=""}{&lt;BR /&gt;if(p=="")&lt;BR /&gt;  p=$1&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;printf p;&lt;BR /&gt;if(p==$1)&lt;BR /&gt;  printf " ";&lt;BR /&gt;else&lt;BR /&gt;  printf "\n";&lt;BR /&gt;p=$1;&lt;BR /&gt;}&lt;BR /&gt;}END{print $1}' file &amp;gt;newfile&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Wed, 17 Apr 2002 12:44:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2705201#M902813</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2002-04-17T12:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2705202#M902814</link>
      <description>Hello Andreas,&lt;BR /&gt;&lt;BR /&gt;Thanks for your help and efforts but I get this error ..may be I am doing some thing wrong.&lt;BR /&gt;&lt;BR /&gt;$ awk -f spl.awk tpp.txt&lt;BR /&gt; syntax error The source line is 1.&lt;BR /&gt; The error context is&lt;BR /&gt;                awk &amp;gt;&amp;gt;&amp;gt;  ' &amp;lt;&amp;lt;&amp;lt; &lt;BR /&gt; awk: Quitting&lt;BR /&gt; The source line is 1.&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 17 Apr 2002 12:59:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2705202#M902814</guid>
      <dc:creator>John McDen</dc:creator>
      <dc:date>2002-04-17T12:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2705203#M902815</link>
      <description>Hi John,&lt;BR /&gt;&lt;BR /&gt;Here's a way to do so in a script:&lt;BR /&gt;&lt;BR /&gt;while read line&lt;BR /&gt;do&lt;BR /&gt;echo "$line\c"&lt;BR /&gt;prev=$line&lt;BR /&gt;while read line&lt;BR /&gt;do&lt;BR /&gt;if [ $prev = $line ]&lt;BR /&gt;then&lt;BR /&gt;echo " $line\c"&lt;BR /&gt;else&lt;BR /&gt;echo "\n$line\c"&lt;BR /&gt;fi&lt;BR /&gt;prev=$line&lt;BR /&gt;done&lt;BR /&gt;done &lt;INFILE&gt;otfile&lt;BR /&gt;echo &amp;gt;&amp;gt;otfile&lt;BR /&gt;&lt;BR /&gt;This only works if the duplicated lines are consecutive in the file.  You could sort the file first to ensure duplicates follow each other.&lt;BR /&gt;&lt;BR /&gt;Darrell&lt;/INFILE&gt;</description>
      <pubDate>Wed, 17 Apr 2002 13:00:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2705203#M902815</guid>
      <dc:creator>Darrell Allen</dc:creator>
      <dc:date>2002-04-17T13:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2705204#M902816</link>
      <description>Hi Darrell Allen &lt;BR /&gt;&lt;BR /&gt;I wish I could give you more then 10 points .. it works really great...&lt;BR /&gt;&lt;BR /&gt;Thanks a Million</description>
      <pubDate>Wed, 17 Apr 2002 13:11:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2705204#M902816</guid>
      <dc:creator>John McDen</dc:creator>
      <dc:date>2002-04-17T13:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2705205#M902817</link>
      <description>You're welcome (and N/A for this please).&lt;BR /&gt;&lt;BR /&gt;Darrell&lt;BR /&gt;</description>
      <pubDate>Wed, 17 Apr 2002 13:16:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2705205#M902817</guid>
      <dc:creator>Darrell Allen</dc:creator>
      <dc:date>2002-04-17T13:16:13Z</dc:date>
    </item>
  </channel>
</rss>

