Solved

sort command HPUX

Posted on 2011-03-10
11
90 Views
Last Modified: 2016-05-30
The sort command looks to be different on HP than Solaris. Can someone tell me the sort command for following records, sorted in ascending order by the date field (4th column below)

Thanks

dd690SYSFULL.001.RO 2773916126 1297521166 02/12/11
dd690SYSFULL.001.RO 90166349 1298125950 02/19/11
dd690SYSFULL.001.RO 1751716709 1298731929 02/26/11
dd690SYSFULL.001.RO 225595826 1299337703 03/05/11
dd690SYSFULL.001.RO 3007587449 1296311459 01/29/11
dd690SYSFULL.001.RO 642604794 1296916263 02/05/11
dd690SYSFULL.001.RO 3780548990 1297521070 02/12/11
dd690SYSFULL.001.RO 727700530 1298125923 02/19/11
dd690SYSFULL.001.RO 3999862400 1298730676 02/26/11
dd690SYSFULL.001.RO 1098008824 1299335470 03/05/11
0
Comment
Question by:sonriks
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 35095636
Does this work?

sort -t" " -n -k 4.7,4.8 -k 4.1,4.2 -k 4.4,4.5 inputfile

?

wmp
0
 
LVL 1

Author Comment

by:sonriks
ID: 35098410
no, didn't work
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 35098495
Why?
Error messages?
Wrong output?

Please remember that it's your problem, not ours!
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:sonriks
ID: 35098763
the column was not sorted correctly.
Comments like yours I can do without.
Please do not attempt to help with this issue.
I will find the answer elsewhere.
0
 
LVL 48

Expert Comment

by:Tintin
ID: 35098914
What output are you getting and what sort command are you using on the Solaris system that works with the same data?
0
 
LVL 3

Expert Comment

by:Alberto Cortes
ID: 35112500
Solution:

      sort -k 4,4 inputfile
0
 
LVL 7

Expert Comment

by:jackiechen858
ID: 35116486
That's not very nice towards some people trying to help you.   I  tried woolmikproc 's command on a HPUX  11 and it actually is working fine.

example file:
dd690SYSFULL.001.RO 90166349 1298125950 02/19/11
dd690SYSFULL.001.RO 2773916126 1297521166 12/12/10
dd690SYSFULL.001.RO 1751716709 1298731929 02/26/11
dd690SYSFULL.001.RO 3007587449 1296311459 09/29/07
dd690SYSFULL.001.RO 225595826 1299337703 09/05/07
dd690SYSFULL.001.RO 642604794 1296916263 02/05/11
dd690SYSFULL.001.RO 3780548990 1297521070 02/12/11
dd690SYSFULL.001.RO 727700530 1298125923 02/19/11
dd690SYSFULL.001.RO 3999862400 1298730676 02/26/11
dd690SYSFULL.001.RO 1098008824 1299335470 03/05/11
dd690SYSFULL.001.RO 1098008824 1299335470 11/11/09

result:
 sort -t" " -n -k 4.7,4.8 -k 4.1,4.2 -k 4.4,4.5 1
dd690SYSFULL.001.RO 225595826 1299337703 09/05/07
dd690SYSFULL.001.RO 3007587449 1296311459 09/29/07
dd690SYSFULL.001.RO 1098008824 1299335470 11/11/09
dd690SYSFULL.001.RO 2773916126 1297521166 12/12/10
dd690SYSFULL.001.RO 642604794 1296916263 02/05/11
dd690SYSFULL.001.RO 3780548990 1297521070 02/12/11
dd690SYSFULL.001.RO 727700530 1298125923 02/19/11
dd690SYSFULL.001.RO 90166349 1298125950 02/19/11
dd690SYSFULL.001.RO 1751716709 1298731929 02/26/11
dd690SYSFULL.001.RO 3999862400 1298730676 02/26/11
dd690SYSFULL.001.RO 1098008824 1299335470 03/05/11




0
 
LVL 1

Author Comment

by:sonriks
ID: 35142530
Thanks to you all. I'll try the above command again. I am impressed by the level of knowledge of folks who use this site, and appreciate the help!
0
 

Expert Comment

by:EE_AutoDeleter
ID: 41623823
I've requested that this question be deleted for the following reason:

                           
No comment has been added to this question in more than 21 days, so it is now classified as abandoned and is now flagged for deletion.


If there is a valid solution, please OBJECT and indicate the comments that are, or would otherwise lead to, a solution.


Use the specific format https:#axxxxxxxx for comment ID(s).


Also, please don't object simply because the author did not respond to your comment. While we understand this is frustrating, unfortunately we cannot force the author to return to the question. Unless you feel you have presented a valid, verifiable solution we'll simply delete the question.


Experts-Exchange Auto Deleter
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 41623824
As confirmed by jackiechen858 (https:#a35116486) the solution in
https:#a35095636
is correct and valid.
0

Featured Post

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to fix error ""Failed to validate the vCentre certificate. Either install or verify the certificate by using the vSphere Data Protection Configuration utility" when you are trying to connect to VDP instance from Vcenter.
In this article we will learn how to backup a VMware farm using Nakivo Backup & Replication. In this tutorial we will install the software on a Windows 2012 R2 Server.
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question