06-12-2009
Sort alpha on 1st field, numerical on 2nd field (sci notation)
I want to sort alphabetically on the first field and sort in descending numerical order on the 2nd field. With a normal "sort -r -n" it does this:
abc ||| 5e-05 ||| bla
abc ||| 3 ||| ble
def ||| 1 ||| abc
def ||| 0.2 ||| def
As you can see it ignores the fact that 5e-05 is actually 0.00005 therefore smaller than 3. The output I want would be
abc ||| 3 ||| ble
abc ||| 5e-05 ||| bla
def ||| 1 ||| abc
def ||| 0.2 ||| def
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hello,
i have a table contain many columns delimited by blank.
i want to sort this table by the 2 columns and 3 one and i want to keep the first line inchanged?
how can i do using the sort command?
thanks
table like :
field1 field2 field3 field4
x y z b
t h r n
.. (4 Replies)
Discussion started by: kamel.seg
4 Replies
2. Shell Programming and Scripting
Hi,
I have a file with this format:
name number
-------------- -----------
AAA 11700
BBB 6000
CCC 6000
I want to catch any of these names if number > 200
How to do that?
at a... (4 Replies)
Discussion started by: melanie_pfefer
4 Replies
3. UNIX for Advanced & Expert Users
05.50.25:AIRE.S:RESTRICTED:S2:
05.50.25:ANDR.VI:RESTRICTED:S2:
05.50.25:BASF.MI:RESTRICTED:N:
05.50.25:BMWG.DE:RESTRICTED:N:
05.50.25:BORE.ST:RESTRICTED:N:
I can sort of the basis of second field using " sort -t: -k2,2 "
but what i want to sort the data is on the basis its extension e.g.:... (9 Replies)
Discussion started by: manishma71
9 Replies
4. Shell Programming and Scripting
Hi,
I've internally searched through forums for about 2+ hours. Unfortunately, with no luck. Although I've found some cases close to mine below, but didn't help so much.
Actually, I'm in short with time. So I had to post my case. Hoping that you can help.
I have 2 files,
FILE1
... (0 Replies)
Discussion started by: amurib
0 Replies
5. Shell Programming and Scripting
Hi,
I've internally searched through forums for about 2+ hours. Unfortunately, with no luck. Although I've found some cases close to mine below, but didn't help so much.
Actually, I'm in short with time. So I had to post my case. Hoping that you can help.
I have 2 files,
FILE1
... (1 Reply)
Discussion started by: amurib
1 Replies
6. Shell Programming and Scripting
Hi,
I am unable to sort data on the first field
$cat t
Jim,212121,Seattle
Bill,404404,Seattle
Steve,246810,Nevada
Scott,212277,LosAngeles
Jim,212121,Ohio
sort -t"," -k1,2 t
Bill,404404,Seattle
Jim,212121,Ohio
Jim,212121,Seattle
Scott,212277,LosAngeles
Steve,246810,Nevada (7 Replies)
Discussion started by: Shivdatta
7 Replies
7. Shell Programming and Scripting
java....4059... compsite 62u IPv4 170747 TCP *:9400 (LISTEN)
java...... 05... compsite 109u IPv4 171216 TCP *:9401 (LISTEN)
This is Joust formated like this
Please Repace "." with space" "
All are Right Justfied
Output :- 4058 and 05 so that i can kill this (1 Reply)
Discussion started by: pareshpatra
1 Replies
8. Shell Programming and Scripting
I have a flatfile A.txt
2012/12/04 14:06:07 |trees|Boards 2, 3|denver|mekong|mekong12
2012/12/04 17:07:22 |trees|Boards 2, 3|denver|mekong|mekong12
2012/12/04 17:13:27 |trees|Boards 2, 3|denver|mekong|mekong12
2012/12/04 14:07:39 |rain|Boards 1|tampa|merced|merced11
How do i sort and get... (3 Replies)
Discussion started by: sabercats
3 Replies
9. UNIX for Dummies Questions & Answers
Hi,
For example:
I have:
HostA,XYZ
HostB,XYZ
HostC,ABC
I would like the output to be:
HostA,HostB: XYZ
HostC:ABC
How can I achieve this?
So far what I though of is: (1 Reply)
Discussion started by: alvinoo
1 Replies
LEARN ABOUT PHP
fs_listcells
FS_LISTCELLS(1) AFS Command Reference FS_LISTCELLS(1)
NAME
fs_listcells - Displays the database server machines known to the Cache Manager
SYNOPSIS
fs listcells [-numeric] [-help]
fs listc [-n] [-h]
DESCRIPTION
The fs listcells command formats and displays the list of the database server machines that the Cache Manager stores in kernel memory for
its home cell and foreign cells.
At each reboot of the client machine, the Cache Manager copies the contents of /etc/openafs/CellServDB into kernel memory. To modify the
list between reboots, use the fs newcell command.
OPTIONS
-numeric
Displays each database server machine's IP address rather than hostname.
-help
Prints the online help for this command. All other valid options are ignored.
OUTPUT
The output includes a line for each cell included in the Cache Manager's kernel memory list, in the following format:
Cell <cell> on hosts <database server machines>
The Cache Manager stores IP addresses, but by default has them translated to hostnames before reporting them, by passing them to the cell's
name service (such as the Domain Name Service or a local host table). The name service sometimes returns hostnames in uppercase letters, or
an IP address if it cannot resolve a name.
Using the -numeric flag bypasses the translation to hostnames, which can result in significantly faster production of output. The output
includes IP addresses only.
EXAMPLES
The following example shows output for several cells as illustrations of the different formats for machine names:
% fs listcells
Cell abc.com on hosts fs1.abc.com fs2.abc.com fs3.abc.com
Cell stateu.edu on hosts DB1.FS.STATEU.EDU
DB2.FS.STATEU.EDU DB3.FS.STATEU.EDU
Cell def.gov on hosts 138.255.0.2 sv3.def.gov
PRIVILEGE REQUIRED
None
SEE ALSO
CellServDB(5), fs_newcell(1)
COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.
This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas
Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.
OpenAFS 2012-03-26 FS_LISTCELLS(1)