Hey guys, I have a file that contains the following:
366 K
364 Q
12 UB
7 INC. P
4 Law
2 LAMB
2 High
1 QEG
1 OF
1 LC
1 B
As you can see, it's already sorted by numerical order, how do I sort it again, breaking the ties by using the alphabetical order of the second column, but... (2 Replies)
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)
Hello,
okey so my script is using 4 variables that are either empty or numbers in the following format:
NUMBER_1 NUMBER_2 NUMBER_3 NUMBER_4
So they're basically separated by a space and I need to echo the lowest number, so far I've been doing it like this:
echo "2 3 1 3" | tr " "... (6 Replies)
I would like to know how to sort version numbers, using bash or perl. I would like to sort file names that are program names with version numbers and extensions, such as hello-0.2.3.tar.gz and hello-0.10.3.tar.gz.
Version numbers of computer programs do not comply with the mathematical rule... (3 Replies)
Although i tried multiple option i couldn't find a way to get the rigt ouput.
Say i have the following data
cat file.txt
C request
C response
C request
C response
The output should look like (9 Replies)
I have files like this:
1
3
4
6
14
3
6
I want to extract the highest number. I have tried using
cat filename | sort
but then 9 would become higher than 14.
So how do I sort? (1 Reply)
I have a file which has the following data :-
how can I sort the data in descending order .
My files may have the first column with 1 to 10000 numbers .I need to arrange them in descending order .
Thanks (2 Replies)
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)
I want to sort my data first by the 2nd field then by the first field.
I can't use sort -V because I don't have gnu sort and cannot install one.
How do I go about this?
Input:
G456 KT1 34
K234 KT10 45
L2 KT2 26
H5 LAF2 28
F3 LAF2 36
Output:
G456 KT1 34
L2 KT2 26
K234 KT10 45
F3... (14 Replies)
Discussion started by: aydj
14 Replies
LEARN ABOUT PHP
yaz_sort
YAZ_SORT(3) 1 YAZ_SORT(3)yaz_sort - Sets sorting criteriaSYNOPSIS
void yaz_sort (resource $id, string $criteria)
DESCRIPTION
This function sets sorting criteria and enables Z39.50 Sort.
Call this function beforeyaz_search(3). Using this function alone does not have any effect. When used in conjunction with yaz_search(3), a
Z39.50 Sort will be sent after a search response has been received and before any records are retrieved with Z39.50 Present
(yaz_present(3).
PARAMETERS
o $id
- The connection resource returned by yaz_connect(3).
o $criteria
- A string that takes the form field1 flags1 field2 flags2 where field1 specifies the primary attributes for sort, field2 seconds,
etc.. The field specifies either a numerical attribute combinations consisting of type=value pairs separated by comma (e.g.
1=4,2=1) ; or the field may specify a plain string criteria (e.g. title. The flags is a sequence of the following characters
which may not be separated by any white space.
Sort Flags
o a - Sort ascending
o d - Sort descending
o i - Case insensitive sorting
o s - Case sensitive sorting
RETURN VALUES
No value is returned.
EXAMPLES
Example #1
Sort Criterias
To sort on Bib1 attribute title, case insensitive, and ascending you would use the following sort criteria:
1=4 ia
If the secondary sorting criteria should be author, case sensitive and ascending you would use:
1=4 ia 1=1003 sa
PHP Documentation Group YAZ_SORT(3)