<?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: sorting question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sorting-question/m-p/3765724#M260313</link>
    <description>Can you show us a sample of the file you want to sort?  Just a few lines will do.  This may help in figuring out how to get it sorted.&lt;BR /&gt;</description>
    <pubDate>Tue, 04 Apr 2006 15:25:32 GMT</pubDate>
    <dc:creator>Patrick Wallek</dc:creator>
    <dc:date>2006-04-04T15:25:32Z</dc:date>
    <item>
      <title>sorting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sorting-question/m-p/3765722#M260311</link>
      <description>&lt;BR /&gt;I want to sort output by the certain column, ie. 4th column. From the man page, the necessary option seems to be -k, so that&lt;BR /&gt;&lt;BR /&gt;cat file | sort -k 5&lt;BR /&gt;&lt;BR /&gt;It sorts it in a different way but it doesn't work. Neither does &lt;BR /&gt;&lt;BR /&gt;cat file | sort -k 5.3&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Apr 2006 15:15:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sorting-question/m-p/3765722#M260311</guid>
      <dc:creator>dictum9</dc:creator>
      <dc:date>2006-04-04T15:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: sorting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sorting-question/m-p/3765723#M260312</link>
      <description>Several things could be wrong. 1) You haven't specified what the separator charactor is so that is the 5th field may not be what sort thinks is the 5th field. Ialso you may need a type specifier such as -k 5n,5 to force numeric comparisons rather than lexical comparisons. For example, if 'n' were not used (and assumming this us the 5th field)&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;10&lt;BR /&gt;20&lt;BR /&gt;100&lt;BR /&gt;&lt;BR /&gt;would actually be sorted as&lt;BR /&gt;&lt;BR /&gt;1&lt;BR /&gt;10&lt;BR /&gt;100&lt;BR /&gt;2&lt;BR /&gt;20&lt;BR /&gt;3&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Apr 2006 15:25:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sorting-question/m-p/3765723#M260312</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-04-04T15:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: sorting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sorting-question/m-p/3765724#M260313</link>
      <description>Can you show us a sample of the file you want to sort?  Just a few lines will do.  This may help in figuring out how to get it sorted.&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Apr 2006 15:25:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sorting-question/m-p/3765724#M260313</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2006-04-04T15:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: sorting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sorting-question/m-p/3765725#M260314</link>
      <description>if you are sorting by 4th column, you should use&lt;BR /&gt;&lt;BR /&gt;cat file | sort -k 4&lt;BR /&gt;&lt;BR /&gt;if this still does not work can you print the outout to here?&lt;BR /&gt;&lt;BR /&gt;Sung</description>
      <pubDate>Tue, 04 Apr 2006 15:26:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sorting-question/m-p/3765725#M260314</guid>
      <dc:creator>Sung Oh</dc:creator>
      <dc:date>2006-04-04T15:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: sorting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sorting-question/m-p/3765726#M260315</link>
      <description>I just use:&lt;BR /&gt;&lt;BR /&gt;cat file | sort +3&lt;BR /&gt;&lt;BR /&gt;Because the columns starts at 0. If you are doinig numeric sorting, use -n, like this:&lt;BR /&gt;&lt;BR /&gt;cat file | sort +3 -nb</description>
      <pubDate>Tue, 04 Apr 2006 15:32:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sorting-question/m-p/3765726#M260315</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2006-04-04T15:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: sorting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sorting-question/m-p/3765727#M260316</link>
      <description>-n flag does the trick, thanks.&lt;BR /&gt;&lt;BR /&gt;( As usual, the man page is cryptic )</description>
      <pubDate>Tue, 04 Apr 2006 15:53:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sorting-question/m-p/3765727#M260316</guid>
      <dc:creator>dictum9</dc:creator>
      <dc:date>2006-04-04T15:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: sorting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sorting-question/m-p/3765728#M260317</link>
      <description>Hi,&lt;BR /&gt;why not sort -n +3 file avoiding cat?&lt;BR /&gt;HTH,&lt;BR /&gt;Art</description>
      <pubDate>Wed, 05 Apr 2006 03:36:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sorting-question/m-p/3765728#M260317</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2006-04-05T03:36:34Z</dc:date>
    </item>
  </channel>
</rss>

