The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Need immediate help with sorting!!! sasuke_uchiha Shell Programming and Scripting 9 08-05-2008 11:07 PM
Sorting : satyam_sat Shell Programming and Scripting 3 04-15-2008 12:30 PM
sorting in awk mahabunta Shell Programming and Scripting 3 01-31-2007 01:56 AM
The Game Problom thepicoman Shell Programming and Scripting 3 06-27-2005 06:52 AM
Sorting mp3 penguin-friend Shell Programming and Scripting 3 05-13-2005 03:21 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-27-2009
sudheer157 sudheer157 is offline
Registered User
  
 

Join Date: Dec 2006
Posts: 5
Problom Sorting

hi all,

i have the test data file which is . seperated as below and i need sort it
EX data:
5.4.11.3
5.4.2.2


after sort result should look like
5.4.2.2
5.4.11.3

thanks in advance.
  #2 (permalink)  
Old 01-27-2009
Ygor's Avatar
Ygor Ygor is offline Forum Staff  
Moderator
  
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,402
Try...
Code:
sort -t "." -k1,1n -k2,2n -k3,3n -k4,4n
  #3 (permalink)  
Old 01-27-2009
sudheer157 sudheer157 is offline
Registered User
  
 

Join Date: Dec 2006
Posts: 5
thanks for reply, this will work ,
but the problom is no of decimal places is really not fixed...
itcan have a singlr char in between as well
ex:
5.4.11.4-v2.2
5.4.2.1-v2.2

any suggestions on how to sort this kind of input.
Sponsored Links
Closed Thread

Bookmarks

Tags
sort decimal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 09:29 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0