Hi,
I have an entry file for a perl script from which I need to remove duplicate entry.
For example:
one:two:three
one:four:five
two:one:three
must become :
one:two:three
two:one:three
The duplicate entry is only the first field. I try many options of sort system command but don't... (4 Replies)
Does anyone have a quick and dirty way of performing a sort and uniq in perl?
How an array with data like:
this is bkupArr BOLADVICE_VN
this is bkupArr MLT6800PROD2A
this is bkupArr MLT6800PROD2A
this is bkupArr BOLADVICE_VN_7YR
this is bkupArr MLT6800PROD2A
I want to sort it... (4 Replies)
Hi,
here is my perl script.This script creates an array and is sorting it using the in-built sort function in perl.
#!/usr/local/bin/perl
my number=6;
my @num_arr=(1,2,3,4,5);
my @array=(23,"$number","Hello",2.345,@num_arr);
#printing the array
print... (2 Replies)
Hi,
May I know, if a pipe separated File is large, what is the best method to calculate the unique row count of 3rd column and get a list of unique value of the 3rdcolum?
Thanks in advance! (20 Replies)
Hi all,
Say i have a array
@array=("abc,"a",ab");
I would like to sort them according to the length.
Any idea? thanks in advanced.
i tried below code, but not work.
sub sort_fun{
if (length shift(@_) >= length shift(@_) ){
return 1;
}
else{
return 0;
}
} (1 Reply)
Hi,
Can anyone advise how to correct my script pls?
I'm not getting the correct output =(
Details below:
Logfile
========
Player Num : 14
Player Name : Jacee Thirkins
MVP winner : 1998
End of details....
Player Num : 35
Player Name : Lander Diaz
MVP winner : 2002... (1 Reply)
Hi
Is there any way I could reproduce the following code in perl 5.8:
sort -u FILE | sort -t: -k1,1 -k2n
which sorts by unicity first, then by first key, then by second key in numeric format.
What I have now is
@sort_array=uniq sort @sort_array;
after the contents of my... (5 Replies)
Hi,
can I sort the fields on the basis of dates in the following format?
from this
Dec 17 2007 2:18:18:000PM
Dec 17 2007 5:18:18:000AM
Jan 19 2009 4:30:02:000AM
Mar 21 2010 9:13:55:000AM
Dec 16 2007 4:29:21:000PM
Dec 24 2009 12:29:23:000PM
to
Dec 16 2007 4:29:21:000PM... (2 Replies)
Hi,
I need help in sorting variables in perl
i have two variables and if those two variables are equal then its good. I have a problem here
example:
variable1= number2 number1
variable2=number1 number2
in my case above both the variables are also equal but the condition is not... (5 Replies)
Discussion started by: rocky1954
5 Replies
LEARN ABOUT MOJAVE
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, separated 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.18.2 2013-07-21 Net::LDAP::Control::Sort(3)