05-21-2019
See post #5. It is the difference between numerical and version number sort..
With version numbers 1.11 comes after 1.9. With numerical sort 1..11 is smaller than than 1.9 .
You had not specified which case applies..
This User Gave Thanks to Scrutinizer For This Post:
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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... (1 Reply)
Discussion started by: FrancoisCN
1 Replies
2. Shell Programming and Scripting
Hi,
This is my input file:
ali 5 usa abc
abu 4 uk bca
alan 6 brazil bac
pinky 10 utah sdc
My desired output:
pinky 10 utah sdc
alan 6 brazil bac
ali 5 usa abc
abu 4 uk bca
Based on the column two, I want to do the descending order and print out other related column at the... (3 Replies)
Discussion started by: patrick87
3 Replies
3. Shell Programming and Scripting
So, I will be working with someone and basically we are trying to build a form that is submitted most likely via the web and the data is just a string of numbers.
like:
19383882872201110929282821818182827349190102837364718191001932873711
Now, each number is part of a numerical value of... (4 Replies)
Discussion started by: tlarkin
4 Replies
4. Shell Programming and Scripting
Hello,
I have this sample data:
01 * * * *
01 * * * *
01 * * * *
01 * * * *
01 0 * * *
01 0 * * *
01 0 * * *
01 0 * * *
02 * * * 0
02 * * * 0
02 * * * 6
02 * * * 6
02 0 * * 1
02 0 * * 1
02 0 * * 2
02 0 * * 2
02 0 * * 3 (3 Replies)
Discussion started by: gio001
3 Replies
5. UNIX for Advanced & Expert Users
Hello all -
I am to this forum and fairly new in learning unix and finding some difficulty in preparing a small shell script. I am trying to make script to sort all the files given by user as input (either the exact full name of the file or say the files matching the criteria like all files... (3 Replies)
Discussion started by: pankaj80
3 Replies
6. UNIX for Dummies Questions & Answers
I have a column of numbers in the following format:
1.722e-05
2.018e-05
2.548e-05
2.747e-05
7.897e-05
4.016e-05
4.613e-05
4.613e-05
5.151e-05
5.151e-05
5.151e-05
6.1e-05
6.254e-05
7.04e-05
7.12e-05
7.12e-05 (6 Replies)
Discussion started by: evelibertine
6 Replies
7. 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
8. Shell Programming and Scripting
Hi Experts,
I have a filelist collected from another server , now want to sort the output using date/time stamp filed.
- Filed 6, 7,8 are showing the date/time/stamp.
Here is the input:
#----------------------------------------------------------------------
-rw------- 1 root ... (3 Replies)
Discussion started by: rveri
3 Replies
9. UNIX for Beginners Questions & Answers
Hi,
PROCINFO seems to be a great function but I don't manage to make it works.
input:
B,A,C
B
B,B
As an example, just want to count the occurence of each letter across the input and sort them by decreased order.
Wanted output:
B 4
A 1
C 1
When I use this command, the PROCINFO... (4 Replies)
Discussion started by: beca123456
4 Replies
LEARN ABOUT DEBIAN
dcsort
DCSORT(1) DICOM PS3 - Make sorted list of images DCSORT(1)
NAME
dcsort - ACR/NEMA DICOM PS3 ... DICOM PS3 - Make sorted list of images
SYNOPSIS
dcsort " inputfile1 [ inputfile2 ... ]" [ -v|verbose ] [ -vv|veryverbose ] [ -vvv|veryveryverbose ] [ -index ] [ -show ] [ -interval ] [
-tolerance mm ] [ -check ] [ -checkFoR ] [ -descending ] [ -sortby|k attributename ]
DESCRIPTION
dcsort reads the named dicom input files and sorts them by the specified sort key.
The sort key should be a single valued numeric attribute, with the exception of ImageOrientationPatient and ImagePositionPatient which are
handled as special cases.
There is no output by default unless the index or verbose options are specified.
OPTIONS
The output and errors go to standard error.
The basic input switches are described in dcintro(1). Options specific to this program are:
-index
Creates a first column of output that is the index in the sort order, starting from 0, and a second column that is the filename.
-show
Show the value of the sort key after the file name with the -index option
-interval
Show the interval between values of the sort key, or an error if not equal
-tolerance mm
The tolerance value in mm to use when comparing intervals between slices; defaults to +/- 0.01 mm if unspecified
-check
Check that all the images are from the same series.
-checkFoR
Check that all the images have the same Frame of Reference (UID).
-descending
Sort in descending, rather than the default ascending, order.
-sortby|k attributename
Specify attributename as the sort key.
ENVIRONMENT
EXAMPLES
% dcsort -index -sortby SliceLocation ./1/[0-9]*
0 ./1/1
1 ./1/2
FILES
SEE ALSO
dcintro(1)
AUTHOR
Copyright (C) 1993-2010. David A. Clunie DBA PixelMed Publishing. All rights reserved.
BUGS
DICOM PS3 22 December 2006 DCSORT(1)