<?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 command question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command-question/m-p/3360872#M871452</link>
    <description>Hi Muthu&lt;BR /&gt;&lt;BR /&gt;sort -t, -k 3,3 -k 2,2&lt;BR /&gt;&lt;BR /&gt;works</description>
    <pubDate>Thu, 19 Aug 2004 04:09:27 GMT</pubDate>
    <dc:creator>kenny chia</dc:creator>
    <dc:date>2004-08-19T04:09:27Z</dc:date>
    <item>
      <title>sort command question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command-question/m-p/3360868#M871446</link>
      <description>I need to sort a csv file by the 3rd column then by the 2nd column&lt;BR /&gt;&lt;BR /&gt;I used the following command  &lt;BR /&gt;&lt;BR /&gt;sort -t, -k 3,2 data.csv&lt;BR /&gt;&lt;BR /&gt;but it ends up sorting by column 2 then by column 3 only&lt;BR /&gt;&lt;BR /&gt;how should I sort by column 3 then column 2??&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 19 Aug 2004 03:18:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-command-question/m-p/3360868#M871446</guid>
      <dc:creator>kenny chia</dc:creator>
      <dc:date>2004-08-19T03:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: sort command question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command-question/m-p/3360869#M871448</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Try&lt;BR /&gt;&lt;BR /&gt;sort -t, -k 3,3 -k 2,2  data.csv&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;               steve Steel</description>
      <pubDate>Thu, 19 Aug 2004 03:36:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-command-question/m-p/3360869#M871448</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2004-08-19T03:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: sort command question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command-question/m-p/3360870#M871450</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;cat &lt;FILE&gt; | sort -k 3 -k 2 &amp;gt; &lt;NEW_FILE&gt;&lt;BR /&gt;&lt;BR /&gt;should do the trick&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Franky&lt;/NEW_FILE&gt;&lt;/FILE&gt;</description>
      <pubDate>Thu, 19 Aug 2004 03:44:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-command-question/m-p/3360870#M871450</guid>
      <dc:creator>Franky_1</dc:creator>
      <dc:date>2004-08-19T03:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: sort command question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command-question/m-p/3360871#M871451</link>
      <description>We can not use key values as,&lt;BR /&gt;&lt;BR /&gt; -k 3,2&lt;BR /&gt;&lt;BR /&gt; start point of key = 3&lt;BR /&gt; end point ok key = 2&lt;BR /&gt;&lt;BR /&gt; Man page --&amp;gt;&lt;BR /&gt;The characters at positions&lt;BR /&gt;       field_start and field_end are included in the key&lt;BR /&gt;       field, providing that field_end does not precede&lt;BR /&gt;       field_start.&lt;BR /&gt;&lt;BR /&gt; IF you want to sort based on column 3 first then column 2 next then,&lt;BR /&gt;&lt;BR /&gt; use two keys as,&lt;BR /&gt; &lt;BR /&gt; -k 3 -k 2 ( -k 3,3 -k 2,2 )&lt;BR /&gt;&lt;BR /&gt; it will process sorting with 3rd field then 2nd field.&lt;BR /&gt;&lt;BR /&gt; Examples:&lt;BR /&gt;Master1 # cat /tmp/for.log&lt;BR /&gt;hai,23,4&lt;BR /&gt;bye,56,1&lt;BR /&gt;you,67,2&lt;BR /&gt;me,34,6&lt;BR /&gt;&lt;BR /&gt;Master1 # sort -t , -k 3 -k 2 /tmp/for.log&lt;BR /&gt;bye,56,1&lt;BR /&gt;you,67,2&lt;BR /&gt;hai,23,4&lt;BR /&gt;me,34,6&lt;BR /&gt;&lt;BR /&gt;Master1 # sort -t , -k 3,2 /tmp/for.log&lt;BR /&gt;bye,56,1&lt;BR /&gt;hai,23,4&lt;BR /&gt;me,34,6&lt;BR /&gt;you,67,2&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Muthu&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 19 Aug 2004 03:50:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-command-question/m-p/3360871#M871451</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-08-19T03:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: sort command question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command-question/m-p/3360872#M871452</link>
      <description>Hi Muthu&lt;BR /&gt;&lt;BR /&gt;sort -t, -k 3,3 -k 2,2&lt;BR /&gt;&lt;BR /&gt;works</description>
      <pubDate>Thu, 19 Aug 2004 04:09:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-command-question/m-p/3360872#M871452</guid>
      <dc:creator>kenny chia</dc:creator>
      <dc:date>2004-08-19T04:09:27Z</dc:date>
    </item>
  </channel>
</rss>

