Sponsored Content
Top Forums Shell Programming and Scripting Trouble sorting numbers embedded Post 302181924 by mycrew2008 on Friday 4th of April 2008 12:41:10 PM
Old 04-04-2008
Awsome Works like a champ!

Quote:
Originally Posted by vgersh99
Code:
nawk -F'[( ]' '{print $(NF-1) "\t" $0}' conlb.txt  | sort -rn -k1,1 | cut -f2-

Hey vgersh99.

This is fantastic. One question though that i can not figure out. what is the "\t" doing special? If I replace it with a space " " I get the (NF-1) first in the print out but the "\t" is keeping it in the orginal location.

Thanks again!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sorting ASCII string containing numbers

I have the following output where I need to sort the second column numerically (starting with IBMULT3580-TD10 and ending in IBMULT3580-TD123) Drv DriveName 0 IBMULT3580-TD13 1 IBMULT3580-TD18 2 IBMULT3580-TD14 3 IBMULT3580-TD10 4 IBMULT3580-TD11 5 IBMULT3580-TD17 ... (8 Replies)
Discussion started by: GKnight
8 Replies

2. UNIX for Dummies Questions & Answers

sorting numbers with sort -n

Looking for help for sort, I learned that for sorting numbers I use: sort -n but it seems that that is not enough when you have numbers like 0.2000E+7 for example, sort -n will not worry about the E+7 part, and will just sort the numbers like 0.2000. Exapmle: cat example.txt .91000E+07... (9 Replies)
Discussion started by: cosmologist
9 Replies

3. Shell Programming and Scripting

Sorting numbers containing symbols

hi all, i need help on sorting data. i have a file as below /home/oracle $ cat 234.txt +1234 -2356 -1001 +231 0023 -0987 +19000 65487 6 after sorting i want the output as below -2356 -1001 (2 Replies)
Discussion started by: mahesh1987
2 Replies

4. UNIX for Dummies Questions & Answers

Sorting files ending in numbers with "sort"

I have a group of files that I need to be sorted by number. I have tried to use the sort command without any luck. ls includes* includes1 includes10 includes11 includes12 includes2 includes3 includes4 includes5 includes6 includes7 includes8 includes9 I have tried ls includes*... (6 Replies)
Discussion started by: newbie2010
6 Replies

5. Shell Programming and Scripting

Sorting mixed numbers and letters

Hello, I have a file such as this: chr1 chr2 chr1 chr2 chr3 chr10 chr4 chr5 chrz chr1AI want to sort it, I use this command: sort -k1 -th -n testfilebut I get this output, how can I fix this? chr1 chr1 chr10 chr1A chr2 chr2 (3 Replies)
Discussion started by: Homa
3 Replies

6. UNIX for Dummies Questions & Answers

Trouble in Sorting

sorting can i do it using simple perl script/awk? (5 Replies)
Discussion started by: sa@@
5 Replies

7. Shell Programming and Scripting

Help: Sorting the numbers without using sort command

Hi, I've got two arrays 1 3 5 7 2 4 6 8 and i need to write a shell script to get the output 1 2 3 4 5 6 7 8 without using sort or bubble sort. (1 Reply)
Discussion started by: web2moha
1 Replies

8. Shell Programming and Scripting

Help with Sorting numbers in a file

Hi Guys, Would appreciate some help on sorting numbers on a file using the sort command. I have tried this and it's not sorting properly. what am i missing? cat testing_sort 1:21 4:18 2:17 7:14 9:19 3:12 0:16 8:13 5:20 6:15 10:11 sort -t: -nk1,1 -nk2,2 testing_sort (4 Replies)
Discussion started by: Apollo
4 Replies

9. OS X (Apple)

Sorting scientific numbers with sort

Hey everybody, I'm trying to sort scientific numbers in a descending order using the command sort -gr <file>. It works fine on a Linux-Server, but doesn't on my macbook pro with OS X 10.10.3 (Yosemite). I tried to sort the following: 6.38e-10 6.38e-10 1.80e-11 1.00e-10 1.48e-12 And... (9 Replies)
Discussion started by: plebs
9 Replies

10. UNIX for Dummies Questions & Answers

Sorting numerically considering both negative and positve numbers

Dear Experts, I have an IP file which looks like below ---- 100 200 5.02 100 200 -2.99 100 200 -3.01 200 300 2.05 200 300 3.01 200 300 -5.06 I want an OP which looks like (decreasing numerically)-- 100 200 5.02 100 200 -2.99 100 200 -3.01 200 300 3.01 200 300 2.05 200 300 -5.06 (2 Replies)
Discussion started by: Indra2011
2 Replies
NAMAZU(1)							  Namazu Project							 NAMAZU(1)

NAME
namazu - a search program of Namazu SYNOPSIS
namazu [options] <query> [index]... DESCRIPTION
namazu 2.0.9, a search program of Namazu. -n, --max=NUM set number of documents shown to NUM. -w, --whence=NUM set first number of documents shown to NUM. -l, --list print results by listing format. -s, --short print results by short format. --result=EXT set NMZ.result.EXT for printing results. --late sort documents in late order. --early sort documents in early order. --sort=METHOD set a sort METHOD (score, date, field:name) --ascending sort in ascending order (default: descending) -a, --all print all results. -c, --count print only number of hits. -h, --html print in HTML format. -r, --no-references do not display reference hit counts. -H, --page print further result links. (nearly meaningless) -F, --form force to print <form> ... </form> region. -R, --no-replace do not replace URI string. -U, --no-decode-uri do not decode URI when printing in a plain format. -o, --output=FILE set the output file name to FILE. -f, --config=FILE set the config file name to FILE. -C, --show-config print current configuration. -q, --quiet do not display extra messages except search results. -d, --debug be debug mode. -v, --version show the version of namazu and exit. --help show this help and exit REPORTING BUGS
Report bugs to <bug-namazu@namazu.org>. COPYRIGHT
Copyright (C) 1997-1999 Satoru Takabayashi All rights reserved. Copyright (C) 2000,2001 Namazu Project All rights reserved. This is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. namazu of Namazu 2.0.9 November 2001 NAMAZU(1)
All times are GMT -4. The time now is 09:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy