10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
From googling and reading man pages I figured out this sorts the first column by numeric values.
sort -g -k 1,1
Why does the -n option not work? The man pages were a bit confusing.
And what if I want to sort the second column numerically? I haven't been able to figure that out. The file... (7 Replies)
Discussion started by: cokedude
7 Replies
2. Shell Programming and Scripting
Input file:
100%ABC2 3.44E-12 USA
A2M%H02579 0E0 UK
100%ABC2 5.34E-8 UK
100%ABC2 3.25E-12 USA
A2M%H02579 5E-45 UK
Output file:
100%ABC2 3.44E-12 USA
100%ABC2 3.25E-12 USA
100%ABC2 5.34E-8 UK
A2M%H02579 0E0 UK
A2M%H02579 5E-45 UK
Code try:
sort -k1,1 -g -k2 -r input.txt... (2 Replies)
Discussion started by: perl_beginner
2 Replies
3. Shell Programming and Scripting
I have ran into a heavy case of PEBCAK*) and could need some advice on what i do wrong:
OS is Linux (kernel 2.6.35), sort --version reports "8.5" from 2010, shell is ksh.
Originally i had a file with with the following structure:
hdisk1 yyy
hdisk2 yyy
hdisk3 yyy
hdisk4 yyy
hdisk5 yyy... (2 Replies)
Discussion started by: bakunin
2 Replies
4. Shell Programming and Scripting
Hi All,
I have a file menu_opts is as follows
# cat menu_opts
Please select the options
qqqq_usb STD RETAIL Progs (Prime time cue advertisements)
qqqq_onc STD Dealer Progs (Prime time cue advertisements)
qqqq_zt_usb STD RETAIL Progs (Long Format cue... (2 Replies)
Discussion started by: maverick_here
2 Replies
5. UNIX for Dummies Questions & Answers
dear all,
i have .dat files named as:
34.dat
2.dat
16.dat
107.dat
i would like to sort them by their filenames as:
2.dat
16.dat
34.dat
107.dat
i have tried numerous combinations of sort and ls command (in vain) to obtain :
107.dat
16.dat
2.dat
34.dat (1 Reply)
Discussion started by: chen.xiao.po
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. Linux
HI everyone,
I am trying to use the unix sort command to get a list of numbers sorted in ascending order but having trouble in getting it to work.
An example of this issue would be when i am trying to sort the following three
number each on a different line "1" , "2" and "116" the sort command... (3 Replies)
Discussion started by: wali4813
3 Replies
8. Shell Programming and Scripting
Hello all
I have data like below where the column with values (PRI, SEC ) is the char field and the rest are Numeric Fields.
200707,9580,58,7,2,1,PRI,1,1,137,205594,0,5,10,-45.51,-45.51
200707,9580,58,7,2,1,SEC,1,1,137,205594,0,5,10,-45.51,45.51... (1 Reply)
Discussion started by: vasuarjula
1 Replies
9. UNIX for Dummies Questions & Answers
I have a directory with a large number (1000s) of files and I need to produce a file listing all the files in the directory ordered "properly" (properly will be explained shortly).
The files have the following naming pattern:
bul_13_5_228_b.txt
bul_1_3_57.txt
bul_13_6_229.txt... (2 Replies)
Discussion started by: fdsayre
2 Replies
10. Shell Programming and Scripting
i want to sort time field given by who command as a whole
i have tried like this
who|sort -n +4 -5 (1 Reply)
Discussion started by: rahulspatil_111
1 Replies