Sorting a file in descending order when you have 10e- values | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


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 !!

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

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 12-11-2012
evelibertine evelibertine is offline
Registered User
 
Join Date: May 2011
Last Activity: 22 August 2014, 5:12 AM 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 12-11-2012
Yoda's Avatar
Yoda Yoda is offline Forum Advisor  
Jedi Master
 
Join Date: Jan 2012
Last Activity: 30 October 2014, 6:50 PM EDT
Location: Galactic Empire
Posts: 3,387
Thanks: 235
Thanked 1,209 Times in 1,135 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
Closed Thread

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 06:41 AM.