Hi,
I want a list of entries in 3 space delimited columns. I want to sort entries based on the very first column. Rows can't be changed. For example:
If I have...
Abc Abc Acc
Bca Bda Bdd
Cab Cab Cbc
Dbc Dca Dda
Abc Abc Acc
the output should be...
Abc Abc Acc
Abc Abc Acc
Bca... (7 Replies)
Hi ,
I need to sort a file based on multiple columns All the columns are of varchar type
can any one give me the command to sort for varchar columns?
Thanks (3 Replies)
Hi,
We have a requirement of need to sort a file based on fields 1,3 and 4. I tried with sort command however it is not giving expected output, can we achieve any other way? Please let me know ASAP.
File
a e w a
a b a a
a a d g
a a h h
c d a e
a a a w
Output
a b a a
a a a w
a a d... (4 Replies)
I have a space delimited text file that I would like to sort by multiple columns. First I want to sort by column 1, then by column 2. Both columns are numerical. Thanks! (1 Reply)
i have a file with two columns, and i want to uniquely sort the values in fist column and add the corresponding values in the second columns
eg
file a contents
tom 200
john 300
sow 500
tom 800
james 50
sow 300
output shpould be in file b as
tom 1000
john 300
sow 800
james 50 (0 Replies)
Hi
I have a text file that has four columns (Logonid,First Name,Last Name,Status)
Logonid First Name Last Name Status
abc2 Fred Mercury Inactive
abc1 John Deacon Active
abc3 Roger Taylor Active
abc4 Brian ... (2 Replies)
Hello all,
I am using printf to print the sorted o/p in my script.I am trying to sort in following way but doesn't work.
printf "%13s %2s UDP %15s:%s Program %4s HD: %23s HD: %23s %10s %s %s %3s days %3s hours\n" $encoder $i "${ipaddr}" ${portno} ${progno} ${inres} ${outres} ${inrate}... (4 Replies)
Hello!
So ive been presented with this comma-delimited file:
I need a print to look as below
"
lastname, phone_number, zip
for every person with a last name starting with the letter H, I
only with a 650-area code phone number. output should be sorted by reverse ZIP code "
I only have... (5 Replies)
Dear all,
I need your help to sort out a file with more then 15, 000 rows,
input file has following format :
AT4560 GO:1289GO:8915GO:9243GO:5739GO:6757GO:9245GO:9507output should be like:
AT4560 GO:1289
AT4560 GO:8915
AT4560 GO:9243
AT4560 GO:5739
AT4560 GO:6757
AT4560 GO:9245... (5 Replies)
Hi, I have a tab delimited columnar file where I want to remove lines wherever two particular columns match. so for this file, I want to toss the lines where columns 1 and 2 match:
a a 1 3
a b 2 4
b b 3 5
because there are matches column 1 and 2 in lines 1 and 3, I would like a script to... (2 Replies)
Discussion started by: mikey11415
2 Replies
LEARN ABOUT CENTOS
net::ldap::control::sort
Net::LDAP::Control::Sort(3) User Contributed Perl Documentation Net::LDAP::Control::Sort(3)NAME
Net::LDAP::Control::Sort - Server Side Sort (SSS) control object
SYNOPSIS
use Net::LDAP::Control::Sort;
use Net::LDAP::Constant qw(LDAP_CONTROL_SORTRESULT);
$sort = Net::LDAP::Control::Sort->new(
order => "cn -phone"
);
$mesg = $ldap->search( @args, control => [ $sort ]);
($resp) = $mesg->control( LDAP_CONTROL_SORTRESULT );
print "Results are sorted
" if $resp and !$resp->result;
DESCRIPTION
"Net::LDAP::Control::Sort" is a sub-class of Net::LDAP::Control. It provides a class for manipulating the LDAP Server Side Sort (SSS)
request control 1.2.840.113556.1.4.473 as defined in RFC-2891
If the server supports sorting, then the response from a search operation will include a sort result control. This control is handled by
Net::LDAP::Control::SortResult.
CONSTRUCTOR ARGUMENTS
order
A string which defines how entries may be sorted. It consists of multiple directives, spearated by whitespace. Each directive describes
how to sort entries using a single attribute. If two entries have identical attributes, then the next directive in the list is used.
Each directive specifies a sorting order as follows
-attributeType:orderingRule
The leading "-" is optional, and if present indicates that the sorting order should be reversed. "attributeType" is the attribute name
to sort by. "orderingRule" is optional and indicates the rule to use for the sort and should be valid for the given "attributeType".
Any one attributeType should only appear once in the sorting list.
Examples
"cn" sort by cn using the default ordering rule for the cn attribute
"-cn" sort by cn using the reverse of the default ordering rule
"age cn" sort by age first, then by cn using the default ordering rules
"cn:1.2.3.4" sort by cn using the ordering rule defined as 1.2.3.4
METHODS
As with Net::LDAP::Control each constructor argument described above is also available as a method on the object which will return the
current value for the attribute if called without an argument, and set a new value for the attribute if called with an argument.
SEE ALSO
Net::LDAP, Net::LDAP::Control::SortResult, Net::LDAP::Control, http://www.ietf.org/rfc/rfc2891.txt
AUTHOR
Graham Barr <gbarr@pobox.com>
Please report any bugs, or post any suggestions, to the perl-ldap mailing list <perl-ldap@perl.org>
COPYRIGHT
Copyright (c) 1999-2004 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the
same terms as Perl itself.
perl v5.16.3 2013-06-07 Net::LDAP::Control::Sort(3)