Find the answer to your Linux question:
Results 1 to 2 of 2
Hey, I'm trying to sort a list of numbers that has a non-numerical header, but when I do the sort function I cannot keep it from placing the header at ...
  1. #1
    Just Joined!
    Join Date
    Mar 2009
    Posts
    1

    Excluding certain lines from a sort

    Hey, I'm trying to sort a list of numbers that has a non-numerical header, but when I do the sort function I cannot keep it from placing the header at the bottom, after the numbers. I've searched to see if sort has any kind of exclude command, with no luck. Any help would be greatly appreciated!

  2. #2
    Just Joined!
    Join Date
    Mar 2009
    Posts
    6
    Quote Originally Posted by lazypeterson View Post
    Hey, I'm trying to sort a list of numbers that has a non-numerical header, but when I do the sort function I cannot keep it from placing the header at the bottom, after the numbers. I've searched to see if sort has any kind of exclude command, with no luck. Any help would be greatly appreciated!
    sort -r
    reverse sort

    sed -s "s/^[A-z][A-z]*//g"
    get rid of non-numberic lines

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...