<?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 sort question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-question/m-p/4924267#M408528</link>
    <description>I have a file with multiple node names in it. I need to know how many times does a node name appear in a file&lt;BR /&gt;I am looking for something to give result like&lt;BR /&gt;NodeA &lt;COUNT&gt;&lt;BR /&gt;NodeB &lt;COUNT&gt;&lt;/COUNT&gt;&lt;/COUNT&gt;</description>
    <pubDate>Wed, 07 Sep 2005 10:37:46 GMT</pubDate>
    <dc:creator>machoq1</dc:creator>
    <dc:date>2005-09-07T10:37:46Z</dc:date>
    <item>
      <title>sort question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-question/m-p/4924267#M408528</link>
      <description>I have a file with multiple node names in it. I need to know how many times does a node name appear in a file&lt;BR /&gt;I am looking for something to give result like&lt;BR /&gt;NodeA &lt;COUNT&gt;&lt;BR /&gt;NodeB &lt;COUNT&gt;&lt;/COUNT&gt;&lt;/COUNT&gt;</description>
      <pubDate>Wed, 07 Sep 2005 10:37:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-question/m-p/4924267#M408528</guid>
      <dc:creator>machoq1</dc:creator>
      <dc:date>2005-09-07T10:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: sort question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-question/m-p/4924268#M408529</link>
      <description>In addition to piping your results to the sort utility, also pipe to the uniq utility&lt;BR /&gt;&lt;BR /&gt;... | sort | uniq -c&lt;BR /&gt;&lt;BR /&gt;This list each item individually with a count of how many times it is listed.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Sep 2005 10:41:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-question/m-p/4924268#M408529</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2005-09-07T10:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: sort question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-question/m-p/4924269#M408530</link>
      <description>Thanks !</description>
      <pubDate>Wed, 07 Sep 2005 10:43:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-question/m-p/4924269#M408530</guid>
      <dc:creator>machoq1</dc:creator>
      <dc:date>2005-09-07T10:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: sort question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-question/m-p/4924270#M408531</link>
      <description>If this file contains nothing but the host names&lt;BR /&gt;&lt;BR /&gt;you can use this:&lt;BR /&gt;&lt;BR /&gt;myinfile=/path/somefilename&lt;BR /&gt;outfile=/path/myoutfilename&lt;BR /&gt;&lt;BR /&gt;#in case multiple host names on one line we'll separate them&lt;BR /&gt;for h in `cat $myinfile`&lt;BR /&gt;do&lt;BR /&gt;echo $h &amp;gt; /tmp/temphostfile&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;for host in `cat /tmp/temphostfile|sort|uniq`&lt;BR /&gt;do&lt;BR /&gt;ct=`grep $host /tmp/hostfile |wc -l`&lt;BR /&gt;echo $host"  "$count &amp;gt;&amp;gt; $outfile&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;if you can provide a section of your input file, you can get more sensible answers</description>
      <pubDate>Wed, 07 Sep 2005 10:45:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-question/m-p/4924270#M408531</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2005-09-07T10:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: sort question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-question/m-p/4924271#M408532</link>
      <description>Given a data file containing&lt;BR /&gt;&lt;BR /&gt;NodeA&lt;BR /&gt;NodeC&lt;BR /&gt;NodeB&lt;BR /&gt;NodeB&lt;BR /&gt;NodeC&lt;BR /&gt;NodeA&lt;BR /&gt;NodeA&lt;BR /&gt;NodeA&lt;BR /&gt;NodeA&lt;BR /&gt;NodeC&lt;BR /&gt;NodeC&lt;BR /&gt;&lt;BR /&gt;running the script&lt;BR /&gt;&lt;BR /&gt;sort node.dat|uniq |while read node;do&lt;BR /&gt;   echo "$node = \c"         &lt;BR /&gt;   echo "`grep $node node.dat |wc -l`"&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;produces&lt;BR /&gt;&lt;BR /&gt;NodeA = 5&lt;BR /&gt;NodeB = 2&lt;BR /&gt;NodeC = 4&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Sep 2005 10:47:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-question/m-p/4924271#M408532</guid>
      <dc:creator>Alan Meyer_4</dc:creator>
      <dc:date>2005-09-07T10:47:28Z</dc:date>
    </item>
  </channel>
</rss>

