Unix/Linux Go Back    


UNIX for Dummies Questions & Answers This forum is closed for new posts. Please post beginner questions to learn unix and learn linux in this forum UNIX for Beginners Questions & Answers

Sorting a file in descending order when you have 10e- values

UNIX for Dummies Questions & Answers


 
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 12-11-2012
evelibertine evelibertine is offline
Registered User
 
Join Date: May 2011
Last Activity: 21 September 2015, 10:44 PM EDT
Posts: 193
Thanks: 94
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 Unix and Linux 12-11-2012
Yoda's Unix or Linux Image
Yoda Yoda is offline Forum Advisor  
Jedi Master
 
Join Date: Jan 2012
Last Activity: 5 December 2016, 4:51 PM EST
Location: Galactic Empire
Posts: 3,529
Thanks: 248
Thanked 1,281 Times in 1,203 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
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux 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 02:38 PM
script for remove descending order number nithyanandan Shell Programming and Scripting 6 09-23-2011 03:37 AM
how to list descending order jyotidas UNIX for Dummies Questions & Answers 1 09-23-2010 08:54 AM
Ascending & Descending order numbers pravani1 Shell Programming and Scripting 6 06-03-2008 08:43 AM
how to see disk usage in descending order asutoshch UNIX for Dummies Questions & Answers 8 09-18-2001 09:58 PM



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