Sponsored Content
Full Discussion: Sort by specific order?
Top Forums Shell Programming and Scripting Sort by specific order? Post 302764933 by cabrao on Friday 1st of February 2013 06:40:11 AM
Old 02-01-2013
Sort by specific order?

Hello all

I was wondering if someone has an idea how to sort by a specific order, let's say by a specific alphabet containing only 4 letters like (d,s,a,p) instead of (a,b,c....z) ??

Cheers!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Sort / ascending order

What's the command to sort a file in ascending order and redirect the output to another file? Thanks!!!!!! (1 Reply)
Discussion started by: gyik
1 Replies

2. UNIX for Dummies Questions & Answers

Sort - original order .... Help

Hi all, I want to sort a file based on the number in the 9th column I've tried both of the following commands sort -k 9,9n file_to_sort.dat sort +8 -n file_to_sort.dat both resulting in the same output which does sort col 9 nummerically but it doesn't output the lines in the original... (2 Replies)
Discussion started by: olga
2 Replies

3. UNIX for Dummies Questions & Answers

replacing characters in order to sort

hi, i want to rename all the file names in order so that they can be sorted later. For example, my filenames are like path\1, path\2...path\10, path\11. But when I sort them, it sorts by the first number, so path\1 gets sorted with path\10. I'm guessing the best way to do this is to rename... (5 Replies)
Discussion started by: gammaman
5 Replies

4. Shell Programming and Scripting

SORT order in Unix

I am converting mainframes JCL to be used in shell on a one to one basis... when i use the sort command unix does ascii sort as a result which numbers are first followed by charecters in the Ascending sort ... but themainframes uses the EBCDIC as result gives the charecters followed by numbers in... (5 Replies)
Discussion started by: bourne
5 Replies

5. Shell Programming and Scripting

alphabetical order with out using sort command

hai, how can i sort a file alphabetically without using sort command (6 Replies)
Discussion started by: rahul801
6 Replies

6. UNIX for Dummies Questions & Answers

sort -reverse order

I need to sort the particular column only in reverse order how i can give it.. if i give the -r option the whole file is getting sorted in reverse order. 1st 2nd col 3rd C col 4th col 5th col ------------------------------------------- C... (7 Replies)
Discussion started by: sivakumar.rj
7 Replies

7. Shell Programming and Scripting

sort order HP UX / SUN Solaris

Hi! simple 'sort' produces a different output on SUN OS than on HP. Lines with empty fields inside the key are sorted at the beginning on SUN; on HP they are at the end. i.e SUN 03|ref|168126310|702578641|||||||||||||| 03|ref|168126310|702578641|DEL| 03|ref|168126310|702578641|FW|... (5 Replies)
Discussion started by: strolchFX
5 Replies

8. UNIX for Dummies Questions & Answers

sort by column or specific order

Hi, I need to sort it by column or need it in a specific order... input is ===== uid=shashi country= india region =0 ph=0 uid= jon region= asia ph= 12345 country=0 uid = man country= india ph=2222 region=0 uid= neera region= asia ph= 125 country=0 output should be uid=shashi ... (1 Reply)
Discussion started by: hegdeshashi
1 Replies

9. Shell Programming and Scripting

Sort numeric order

Hi I am using this cat substitutionFeats.txt | gawk '{$0=gensub(/\t/,"blabla",1);print}' | gawk '{print length, $0}' | sort -n | sort -r and the "sort -n" command doesn't work as expected: it leads to a wrong ordering: 64 Adjustable cuffs 64 Abrasion- 64 Abrasion pas 647 Sanitized 647... (4 Replies)
Discussion started by: louisJ
4 Replies

10. UNIX for Beginners Questions & Answers

Sort in chronological order

I am trying to sort a log file in chronological order to identify which ones did not process and still have an old (probably yesterday's) date. This is a sample of the file:flatf 010140 flatf Thu May 10 22:22:11 CST 2018 flats finished flatf 010142 flatf Thu May 10 22:31:25 CST 2018 flats... (4 Replies)
Discussion started by: wbport
4 Replies
SLAPO-VALSORT(5)						File Formats Manual						  SLAPO-VALSORT(5)

NAME
slapo-valsort - Value Sorting overlay to slapd SYNOPSIS
/etc/openldap/slapd.conf DESCRIPTION
The Value Sorting overlay can be used with a backend database to sort the values of specific multi-valued attributes within a subtree. The sorting occurs whenever the attributes are returned in a search response. Sorting can be specified in ascending or descending order, using either numeric or alphanumeric sort methods. Additionally, a "weighted" sort can be specified, which uses a numeric weight prepended to the attribute values. The weighted sort is always performed in ascending order, but may be combined with the other methods for values that all have equal weights. The weight is specified by prepending an integer weight {<weight>} in front of each value of the attribute for which weighted sorting is desired. This weighting factor is stripped off and never returned in search results. CONFIGURATION
These slapd.conf options apply to the Value Sorting overlay. They should appear after the overlay directive. valsort-attr <attribute> <baseDN> (<sort-method> | weighted [<sort-method>]) Configure a sorting method for the specified attribute in the subtree rooted at baseDN. The sort-method may be one of alpha-ascend, alpha-descend, numeric-ascend, or numeric-descend. If the special weighted method is specified, a secondary sort-method may also be specified. It is an error to specify an alphanumeric sort-method for an attribute with Integer or NumericString syntax, and it is an error to specify a numeric sort-method for an attribute with a syntax other than Integer or NumericString. EXAMPLES
database bdb suffix dc=example,dc=com ... overlay valsort valsort-attr member ou=groups,dc=example,dc=com alpha-ascend FILES
/etc/openldap/slapd.conf default slapd configuration file SEE ALSO
slapd.conf(5), slapd-config(5). ACKNOWLEDGEMENTS
This module was written in 2005 by Howard Chu of Symas Corporation. The work was sponsored by Stanford University. OpenLDAP 2.4.21 2009/12/20 SLAPO-VALSORT(5)
All times are GMT -4. The time now is 08:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy