Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 12-11-2012
Registered User
 
Join Date: May 2011
Posts: 190
Thanks: 92
Thanked 0 Times in 0 Posts
Sorting a file in descending order when you have 10e- values

Hi,

I am trying to sort the following file in descending order of its fourth column.


Code:
2       1       363828  -2.423225e-03
3       1       363828  4.132763e-03
3       2       363828  8.150133e-03
4       1       363828  4.126890e-03

I use


Code:
sort -k4,4g -r input.txt > output.txt

But the file is still in ascending order. How do I fix this? Thanks!
Sponsored Links
    #2  
Old 12-11-2012
Yoda's Avatar
Jedi Master
 
Join Date: Jan 2012
Location: Galactic Empire
Posts: 2,290
Thanks: 153
Thanked 732 Times in 704 Posts

Code:
sort -k4,4gr input.txt

The Following User Says Thank You to Yoda For This Useful Post:
evelibertine (12-11-2012)
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Sorting values of hash in ascending order using Perl koneru_18 Shell Programming and Scripting 1 07-15-2012 01:38 PM
script for remove descending order number nithyanandan Shell Programming and Scripting 6 09-23-2011 02:37 AM
how to list descending order jyotidas UNIX for Dummies Questions & Answers 1 09-23-2010 07:54 AM
Ascending & Descending order numbers pravani1 Shell Programming and Scripting 6 06-03-2008 07:43 AM
how to see disk usage in descending order asutoshch UNIX for Dummies Questions & Answers 8 09-18-2001 08:58 PM



All times are GMT -4. The time now is 05:02 PM.