<?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: asort problem gawk in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/asort-problem-gawk/m-p/5262659#M659975</link>
    <description>Hi James,&lt;BR /&gt;&lt;BR /&gt;Thanks &lt;BR /&gt;&lt;BR /&gt;It slip my mind to do the split on the 2 Fields and  sorry about the inputs.&lt;BR /&gt;&lt;BR /&gt;Thanks Again&lt;BR /&gt;Chris</description>
    <pubDate>Sat, 13 Nov 2010 21:19:29 GMT</pubDate>
    <dc:creator>Chris Frangandonis</dc:creator>
    <dc:date>2010-11-13T21:19:29Z</dc:date>
    <item>
      <title>asort problem gawk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/asort-problem-gawk/m-p/5262656#M659972</link>
      <description>&lt;BR /&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;I am trying to sort on field 1 9 and 10 which I am doing corretly but my output is printing the array  + line which I dont wont&lt;BR /&gt;&lt;BR /&gt;I only require the line&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;What am i doing wrong&lt;BR /&gt;&lt;BR /&gt;gawk 'BEGIN{FS="|"}{&lt;BR /&gt;                       a[NR]= $1 $9 $10 " " $0&lt;BR /&gt;                }&lt;BR /&gt;        END{n=asort(a)&lt;BR /&gt;                for(i=1;i&amp;lt;=n;++i){&lt;BR /&gt;                print a[i]&lt;BR /&gt;                }&lt;BR /&gt;        }' $1&lt;BR /&gt;        &lt;BR /&gt;File&lt;BR /&gt;====&lt;BR /&gt;001CR|00210|00311|004000001|005655020001086961|00627813121513|00727796148609|00827813121513|00920101112|010130838|01141|0120|01341|01441|015001|016D082|017VODAC|0181|0&lt;BR /&gt;19107|0201105|021|022|023O|024|025T11|026352725030016860|027|028|029|030437520079|031|032|033|034|035|036|037|03827813121513|0390796148609|&lt;BR /&gt;001CR|00210|00311|004000002|005655020002100690|00627735523205|00727813025280|00827813025280|00920101112|010130745|01194|0120|01394|01494|015001|016D083|017MOBILE|0182|&lt;BR /&gt;019107|0202095|021|022|023I|024|025T11|026355806023206690|027|028|029|030437565402|031|032|033|034|035|036|037|03827735523205|03927813025280|&lt;BR /&gt;001CR|00210|00311|004000003|005655020001270625|00627813037563|007184|00827813037563|00920101112|010130940|011|012|013|014|015001|016D004|017TOLLFR|0185|019102|0203005|&lt;BR /&gt;021|022|023O|024|025T22|026351989007412940|027|028|029|030437565403|031|032|033|034|035|036|037|03827813037563|039184|&lt;BR /&gt;&lt;BR /&gt;Output&lt;BR /&gt;======&lt;BR /&gt;[b]001CR00920101112010054743 [\b]001CR|00210|00311|004004717|005655020001939748|00627813007777|007internet|00827813007777|00920101112|010054743|011|012|013|014|015001|016D004&lt;BR /&gt;|017MOBILE|0181|019105|0201101|021|022|023O|024|025B81|026|02743786|02820132|02923654|030437782875|03141.151.254.69|032|033|034|035|036|037|03827813007777|039internet|&lt;BR /&gt;001CR00920101112010061158 001CR|00210|00311|004011415|005655020001519236|00627813165551|007internet|00827813165551|00920101112|010061158|011|012|013|014|015001|016D004&lt;BR /&gt;|017MOBILE|0181|019105|0201101|021|022|023O|024|025B81|026|02710356|0283188|0297168|030438012599|03141.151.254.69|032|033|034|035|036|037|03827813165551|039internet|&lt;BR /&gt;001CR00920101112010065147 001CR|00210|00311|004001202|005655020001803818|00627813713926|007internet|00827813713926|00920101112|010065147|011|012|013|014|015001|016D004&lt;BR /&gt;|017MOBILE|0181|019105|0201101|021|022|023O|024|025B81|026|027768263|028263492|029504771|030437535958|03141.151.254.69|032|033|034|035|036|037|03827813713926|039intern&lt;BR /&gt;et|&lt;BR /&gt;&lt;BR /&gt;Diresired output&lt;BR /&gt;================&lt;BR /&gt;001CR|00210|00311|004004717|005655020001939748|00627813007777|007internet|00827813007777|00920101112|010054743|011|012|013|014|015001|016D004&lt;BR /&gt;|017MOBILE|0181|019105|0201101|021|022|023O|024|025B81|026|02743786|02820132|02923654|030437782875|03141.151.254.69|032|033|034|035|036|037|03827813007777|039internet|&lt;BR /&gt;001CR|00210|00311|004011415|005655020001519236|00627813165551|007internet|00827813165551|00920101112|010061158|011|012|013|014|015001|016D004&lt;BR /&gt;|017MOBILE|0181|019105|0201101|021|022|023O|024|025B81|026|02710356|0283188|0297168|030438012599|03141.151.254.69|032|033|034|035|036|037|03827813165551|039internet|&lt;BR /&gt;001CR|00210|00311|004001202|005655020001803818|00627813713926|007internet|00827813713926|00920101112|010065147|011|012|013|014|015001|016D004&lt;BR /&gt;|017MOBILE|0181|019105|0201101|021|022|023O|024|025B81|026|027768263|028263492|029504771|030437535958|03141.151.254.69|032|033|034|035|036|037|03827813713926|039intern&lt;BR /&gt;et|&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Chris</description>
      <pubDate>Sat, 13 Nov 2010 17:18:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/asort-problem-gawk/m-p/5262656#M659972</guid>
      <dc:creator>Chris Frangandonis</dc:creator>
      <dc:date>2010-11-13T17:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: asort problem gawk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/asort-problem-gawk/m-p/5262657#M659973</link>
      <description>HI Chris:&lt;BR /&gt;&lt;BR /&gt;Your posted input ("file") doesn't appear to contain some of the same strings as either output file.  For example, the sequence "internet" doesn't appear in the input.&lt;BR /&gt;&lt;BR /&gt;The fact that you offered input and output goes a long way to helping, but the Forums mangle text.  Hence, it would be far better to attach files.  Yes, there is only one attachment allowed per post, but that isn't a concern.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; but my output is printing the array + line which I dont wont&lt;BR /&gt;&lt;BR /&gt;You prepend the sort keys to the record, but never snip them off (or skip over them) once the sort has finished and you are printing.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Sat, 13 Nov 2010 20:02:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/asort-problem-gawk/m-p/5262657#M659973</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-11-13T20:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: asort problem gawk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/asort-problem-gawk/m-p/5262658#M659974</link>
      <description>&lt;!--!*#--&gt;Hi (again) Chris:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; I am trying to sort on field 1 9 and 10 which I am doing corretly but my output is printing the array + line which I dont wont&lt;BR /&gt;&lt;BR /&gt;And this variation splits the sort keys from the remainder of the line:&lt;BR /&gt;&lt;BR /&gt;gawk 'BEGIN{FS="|"}{&lt;BR /&gt;a[NR]= $1 $9 $10 " " $0&lt;BR /&gt;}&lt;BR /&gt;END{n=asort(a)&lt;BR /&gt;for(i=1;i&amp;lt;=n;++i){&lt;BR /&gt;    s=a[i]&lt;BR /&gt;    split(s,aa," ")&lt;BR /&gt;    print aa[2]&lt;BR /&gt;}&lt;BR /&gt;}' $1 &lt;BR /&gt;&lt;BR /&gt;...Given input like:&lt;BR /&gt;&lt;BR /&gt;3|x|x|x|x|x|x|x|b|b|zzz&lt;BR /&gt;3|x|x|x|x|x|x|x|c|b|zzz&lt;BR /&gt;3|x|x|x|x|x|x|x|a|b|zzz&lt;BR /&gt;&lt;BR /&gt;...the output using the above script is:&lt;BR /&gt;&lt;BR /&gt;3|x|x|x|x|x|x|x|a|b|zzz&lt;BR /&gt;3|x|x|x|x|x|x|x|b|b|zzz&lt;BR /&gt;3|x|x|x|x|x|x|x|c|b|zzz&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Sat, 13 Nov 2010 21:06:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/asort-problem-gawk/m-p/5262658#M659974</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-11-13T21:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: asort problem gawk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/asort-problem-gawk/m-p/5262659#M659975</link>
      <description>Hi James,&lt;BR /&gt;&lt;BR /&gt;Thanks &lt;BR /&gt;&lt;BR /&gt;It slip my mind to do the split on the 2 Fields and  sorry about the inputs.&lt;BR /&gt;&lt;BR /&gt;Thanks Again&lt;BR /&gt;Chris</description>
      <pubDate>Sat, 13 Nov 2010 21:19:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/asort-problem-gawk/m-p/5262659#M659975</guid>
      <dc:creator>Chris Frangandonis</dc:creator>
      <dc:date>2010-11-13T21:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: asort problem gawk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/asort-problem-gawk/m-p/5262660#M659976</link>
      <description>James &lt;BR /&gt;&lt;BR /&gt;have resolved my question</description>
      <pubDate>Sat, 13 Nov 2010 21:21:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/asort-problem-gawk/m-p/5262660#M659976</guid>
      <dc:creator>Chris Frangandonis</dc:creator>
      <dc:date>2010-11-13T21:21:13Z</dc:date>
    </item>
  </channel>
</rss>

