<?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 command has incorrect results or I don't know what I'm doing in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/sort-command-has-incorrect-results-or-i-don-t-know-what-i-m/m-p/5064220#M94672</link>
    <description>&lt;!--!*#--&gt;I need to sort the following (example) by &lt;BR /&gt;they second field(date) and then the third&lt;BR /&gt;field (time), using the comma as the field&lt;BR /&gt;separator.&lt;BR /&gt;&lt;BR /&gt;1,20051018,154700,67&lt;BR /&gt;2,20051018,142000,8&lt;BR /&gt;3,20051020,1111,67&lt;BR /&gt;4,20051020,222,8&lt;BR /&gt;&lt;BR /&gt;Using cat txt | sort -t , -k2n -k3n&lt;BR /&gt;does not produce the correct results, (but&lt;BR /&gt;does on other OS's).  It comes out like this:&lt;BR /&gt;4,20051020,222,8&lt;BR /&gt;3,20051020,1111,67&lt;BR /&gt;2,20051018,142000,8&lt;BR /&gt;1,20051018,154700,67&lt;BR /&gt;&lt;BR /&gt;(The correct results should have the first&lt;BR /&gt;fields as 2,1,4,3)&lt;BR /&gt;&lt;BR /&gt;I cannot seem to find&lt;BR /&gt;any parameters to get this to sort properly.&lt;BR /&gt;&lt;BR /&gt;HP-UX B.11.11 U 9000/800</description>
    <pubDate>Tue, 21 Aug 2007 11:29:47 GMT</pubDate>
    <dc:creator>Kurt Redlitz</dc:creator>
    <dc:date>2007-08-21T11:29:47Z</dc:date>
    <item>
      <title>Sort command has incorrect results or I don't know what I'm doing</title>
      <link>https://community.hpe.com/t5/operating-system-linux/sort-command-has-incorrect-results-or-i-don-t-know-what-i-m/m-p/5064220#M94672</link>
      <description>&lt;!--!*#--&gt;I need to sort the following (example) by &lt;BR /&gt;they second field(date) and then the third&lt;BR /&gt;field (time), using the comma as the field&lt;BR /&gt;separator.&lt;BR /&gt;&lt;BR /&gt;1,20051018,154700,67&lt;BR /&gt;2,20051018,142000,8&lt;BR /&gt;3,20051020,1111,67&lt;BR /&gt;4,20051020,222,8&lt;BR /&gt;&lt;BR /&gt;Using cat txt | sort -t , -k2n -k3n&lt;BR /&gt;does not produce the correct results, (but&lt;BR /&gt;does on other OS's).  It comes out like this:&lt;BR /&gt;4,20051020,222,8&lt;BR /&gt;3,20051020,1111,67&lt;BR /&gt;2,20051018,142000,8&lt;BR /&gt;1,20051018,154700,67&lt;BR /&gt;&lt;BR /&gt;(The correct results should have the first&lt;BR /&gt;fields as 2,1,4,3)&lt;BR /&gt;&lt;BR /&gt;I cannot seem to find&lt;BR /&gt;any parameters to get this to sort properly.&lt;BR /&gt;&lt;BR /&gt;HP-UX B.11.11 U 9000/800</description>
      <pubDate>Tue, 21 Aug 2007 11:29:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/sort-command-has-incorrect-results-or-i-don-t-know-what-i-m/m-p/5064220#M94672</guid>
      <dc:creator>Kurt Redlitz</dc:creator>
      <dc:date>2007-08-21T11:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: Sort command has incorrect results or I don't know what I'm doing</title>
      <link>https://community.hpe.com/t5/operating-system-linux/sort-command-has-incorrect-results-or-i-don-t-know-what-i-m/m-p/5064221#M94673</link>
      <description>sort -t, -k2,2n -k3,3n &lt;FILENAME&gt;&lt;BR /&gt;&lt;BR /&gt;"cat" isn't necessary btw&lt;/FILENAME&gt;</description>
      <pubDate>Tue, 21 Aug 2007 11:37:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/sort-command-has-incorrect-results-or-i-don-t-know-what-i-m/m-p/5064221#M94673</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2007-08-21T11:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Sort command has incorrect results or I don't know what I'm doing</title>
      <link>https://community.hpe.com/t5/operating-system-linux/sort-command-has-incorrect-results-or-i-don-t-know-what-i-m/m-p/5064222#M94674</link>
      <description>Works for me...what OS are you running this on?&lt;BR /&gt;&lt;BR /&gt;# cat infile&lt;BR /&gt;1,20051018,154700,67&lt;BR /&gt;2,20051018,142000,8&lt;BR /&gt;3,20051020,1111,67&lt;BR /&gt;4,20051020,222,8&lt;BR /&gt;&lt;BR /&gt;# sort -t, -k2,2n -k3,3n infile&lt;BR /&gt;2,20051018,142000,8&lt;BR /&gt;1,20051018,154700,67&lt;BR /&gt;4,20051020,222,8&lt;BR /&gt;3,20051020,1111,67</description>
      <pubDate>Tue, 21 Aug 2007 11:38:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/sort-command-has-incorrect-results-or-i-don-t-know-what-i-m/m-p/5064222#M94674</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-08-21T11:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: Sort command has incorrect results or I don't know what I'm doing</title>
      <link>https://community.hpe.com/t5/operating-system-linux/sort-command-has-incorrect-results-or-i-don-t-know-what-i-m/m-p/5064223#M94675</link>
      <description>check the man page regarding keydefs, if you don't specify the ending field, it sorts using startfield thru end of line.  the -k2,2n restricts the first sort key to the second field only, the 3,3 does the third likewise</description>
      <pubDate>Tue, 21 Aug 2007 11:41:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/sort-command-has-incorrect-results-or-i-don-t-know-what-i-m/m-p/5064223#M94675</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2007-08-21T11:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: Sort command has incorrect results or I don't know what I'm doing</title>
      <link>https://community.hpe.com/t5/operating-system-linux/sort-command-has-incorrect-results-or-i-don-t-know-what-i-m/m-p/5064224#M94676</link>
      <description>&lt;!--!*#--&gt;Thanks so much, I missed the part about the using the end of the line if the field-end is not specified.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Aug 2007 11:44:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/sort-command-has-incorrect-results-or-i-don-t-know-what-i-m/m-p/5064224#M94676</guid>
      <dc:creator>Kurt Redlitz</dc:creator>
      <dc:date>2007-08-21T11:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: Sort command has incorrect results or I don't know what I'm doing</title>
      <link>https://community.hpe.com/t5/operating-system-linux/sort-command-has-incorrect-results-or-i-don-t-know-what-i-m/m-p/5064225#M94677</link>
      <description>You haven't assigned any points yet.  Please read:&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/helptips.do?#33" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/helptips.do?#33&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;You should also close this thread indicating you have a solution.</description>
      <pubDate>Sat, 08 Sep 2007 02:54:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/sort-command-has-incorrect-results-or-i-don-t-know-what-i-m/m-p/5064225#M94677</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-09-08T02:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Sort command has incorrect results or I don't know what I'm doing</title>
      <link>https://community.hpe.com/t5/operating-system-linux/sort-command-has-incorrect-results-or-i-don-t-know-what-i-m/m-p/5064226#M94678</link>
      <description>The solution was provided in the replies.</description>
      <pubDate>Mon, 10 Sep 2007 08:41:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/sort-command-has-incorrect-results-or-i-don-t-know-what-i-m/m-p/5064226#M94678</guid>
      <dc:creator>Kurt Redlitz</dc:creator>
      <dc:date>2007-09-10T08:41:40Z</dc:date>
    </item>
  </channel>
</rss>

