<?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: sort problem in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-problem/m-p/2852508#M826002</link>
    <description>How about ...&lt;BR /&gt;sort -t: -k 1,1 -k 2n,2 filename</description>
    <pubDate>Tue, 26 Nov 2002 16:50:10 GMT</pubDate>
    <dc:creator>Ian Lochray</dc:creator>
    <dc:date>2002-11-26T16:50:10Z</dc:date>
    <item>
      <title>sort problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-problem/m-p/2852507#M826001</link>
      <description>I have a file with contents similar to the following:&lt;BR /&gt;&lt;BR /&gt;S:997&lt;BR /&gt;S:998&lt;BR /&gt;C:998&lt;BR /&gt;S:999&lt;BR /&gt;C:999&lt;BR /&gt;S:1000&lt;BR /&gt;S:1001&lt;BR /&gt;S:1002&lt;BR /&gt;C:1000&lt;BR /&gt;&lt;BR /&gt;I'm trying to sort based on the single character value in the first column and a numeric sort on the second column. I've tried the following command sorting the numeric column first and then the character column.  I have also tried sorting (correctly) on the numeric column into a file and then applying the second sort to the contents of that file, but the numeric portion is in each instance reordered in ascending ascii order even though the second sort instructions should be limited to the first column.&lt;BR /&gt;&lt;BR /&gt;My sort command:&lt;BR /&gt;sort -t: -k 2n,2n &lt;FILE_IN&gt; | sort -t: -k1.1,1.1&lt;BR /&gt;&lt;BR /&gt;Results in:&lt;BR /&gt;C:1000&lt;BR /&gt;C:998&lt;BR /&gt;C:999&lt;BR /&gt;S:1000&lt;BR /&gt;S:1001&lt;BR /&gt;S:1002&lt;BR /&gt;S:997&lt;BR /&gt;S:998&lt;BR /&gt;S:999&lt;BR /&gt;&lt;BR /&gt;Desired result is:&lt;BR /&gt;C:998&lt;BR /&gt;C:999&lt;BR /&gt;C:1000&lt;BR /&gt;S:997&lt;BR /&gt;S:998&lt;BR /&gt;S:999&lt;BR /&gt;S:1000&lt;BR /&gt;S:1001&lt;BR /&gt;S:1002&lt;BR /&gt;&lt;BR /&gt;All suggestions appreciated.&lt;BR /&gt;thanks,&lt;BR /&gt;tim&lt;/FILE_IN&gt;</description>
      <pubDate>Tue, 26 Nov 2002 16:40:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-problem/m-p/2852507#M826001</guid>
      <dc:creator>tim zollers</dc:creator>
      <dc:date>2002-11-26T16:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: sort problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-problem/m-p/2852508#M826002</link>
      <description>How about ...&lt;BR /&gt;sort -t: -k 1,1 -k 2n,2 filename</description>
      <pubDate>Tue, 26 Nov 2002 16:50:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-problem/m-p/2852508#M826002</guid>
      <dc:creator>Ian Lochray</dc:creator>
      <dc:date>2002-11-26T16:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: sort problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-problem/m-p/2852509#M826003</link>
      <description>Hi Tim,&lt;BR /&gt;&lt;BR /&gt;This should sort if for you:&lt;BR /&gt;&lt;BR /&gt;sort -t: -k1,1 -k2,2n filename&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin</description>
      <pubDate>Tue, 26 Nov 2002 16:51:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-problem/m-p/2852509#M826003</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2002-11-26T16:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: sort problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-problem/m-p/2852510#M826004</link>
      <description>try:&lt;BR /&gt;&lt;BR /&gt;sort -t: -k1,1 -k2n,2n &lt;FILE&gt;&lt;BR /&gt;&lt;BR /&gt;Gerrit&lt;/FILE&gt;</description>
      <pubDate>Tue, 26 Nov 2002 16:52:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-problem/m-p/2852510#M826004</guid>
      <dc:creator>Gerrit Kistemaker</dc:creator>
      <dc:date>2002-11-26T16:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: sort problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-problem/m-p/2852511#M826005</link>
      <description>sort -t: -k 1,1 -k 2n,2n&lt;BR /&gt;&lt;BR /&gt;Best regards...&lt;BR /&gt; Dietmar.</description>
      <pubDate>Tue, 26 Nov 2002 16:54:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-problem/m-p/2852511#M826005</guid>
      <dc:creator>Dietmar Konermann</dc:creator>
      <dc:date>2002-11-26T16:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: sort problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-problem/m-p/2852512#M826006</link>
      <description>Thanks to all.  I thought I had tried that in one of my many iterations.&lt;BR /&gt;&lt;BR /&gt;Problem solved.</description>
      <pubDate>Tue, 26 Nov 2002 16:55:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-problem/m-p/2852512#M826006</guid>
      <dc:creator>tim zollers</dc:creator>
      <dc:date>2002-11-26T16:55:15Z</dc:date>
    </item>
  </channel>
</rss>

