Hi,
I have a challenging task,in which i have to find the duplicate files by its name and size,then i need to take anyone of the file.Then i need to open the file and find for more than one pattern and count of that pattern.
Note:These are the samples of two files,but i can have more... (2 Replies)
Hello,
I have a record which split with "," I would like to check..if the field is empty and it will field "NIL" into the field.
input
45111,40404,peter,,0303403,0,030304,john,,9,0,
output
45111,40404,peter,NIL,0303403,0,030304,john,NIL,9,0, (8 Replies)
I want to find the top N entries for a certain field based on the values of another field.
For example if N=3, we want the 3 best values for each entry:
Entry1 ||| 100
Entry1 ||| 95
Entry1 ||| 30
Entry1 ||| 80
Entry1 ||| 50
Entry2 ||| 40
Entry2 ||| 20
Entry2 ||| 10
Entry2 ||| 50... (1 Reply)
hi
i have file as below , i want to add duplicate records like bell_bb to one record with valuve as 15 ( addition of both )
any oneline awk script to achive this ?
header 0
CAMPAIGN_NAME 1
Bell_BB 14
Bell_MONTHLY 803
SOLO_UNBEATABLE 644
Bell_BB 1
Bell_MONTHLY 25
SOLO_UNBEATABLE... (4 Replies)
Hi I have a file with contents like :
101,6789556897,0000795369 - seq - fmt_recs187] - avg_recs
101,4678354769,0000835783 - seq - fmt_recs98] - avg_recs
221,5679787008,0001344589 - seq - fmt_recs1283] - avg_recs
I need to find the sum of the all the values (which are in bold).
here... (6 Replies)
Find a blank field
Hi
I have set of fields that have some blank values, how to find that and get its line noumbers in output file.
Ex:
Col1 col2 col3
11 ss 103
12 104
13 105
14 se 106 (2 Replies)
Hello All,
I am trying a one liner for finding the number of null columns in every line of my flat file.
The format of my flat file is like this
a|b|c|d||||e|f|g|
a|b|c|d||||e|f|g|
I want to count the number of fields delimited by "|" which are blank.
In above case the count should be... (6 Replies)
Hi All,
i have a file like
col1 col2 col3
13 24 NA
12 13 14
11 12 13
14 22 NA
18 26 NA
in this file if i found "NA" other values in the line are also replace by NA
Could you help me! (7 Replies)
Gents,
It is possible to generate a range of values according to column 1 and count the total of rows in the range.
example
input
15.3
15.5
15.8
15.9
16.0
16.1
16.8
17.0
17.5
18.0
output desired
15.0 - 15.9 = 4 (10 Replies)
Discussion started by: jiam912
10 Replies
LEARN ABOUT DEBIAN
cps::governor
CPS::Governor(3pm) User Contributed Perl Documentation CPS::Governor(3pm)NAME
"CPS::Governor" - control the iteration of the "CPS" functions
DESCRIPTION
Objects based on this abstract class are used by the "gk*" variants of the CPS functions, to control their behavior. These objects are
expected to provide a method, "again", which the functions will use to re-invoke iterations of loops, and so on. By providing a different
implementation of this method, governor objects can provide such behaviours as rate-limiting, asynchronisation or parallelism, and
integration with event-based IO frameworks.
CONSTRUCTOR
$gov = CPS::Governor->new
Must be called on a subclass which implements the "again" method. Returns a new instance of a governor object in that class.
SUBCLASS METHODS
Because this is an abstract class, instances of it can only be constructed on a subclass which implements the following methods:
$gov->again( $code, @args )
Execute the function given in the "CODE" reference $code, passing in the arguments @args. If this is going to be executed immediately, it
should be invoked using a tail-call directly by the "again" method, so that the stack does not grow arbitrarily. This can be achieved by,
for example:
@_ = @args;
goto &$code;
Alternatively, the Sub::Call::Tail may be used to apply syntactic sugar, allowing you to write instead:
use Sub::Call::Tail;
...
tail $code->( @args );
EXAMPLES
A Governor With A Time Delay
Consider the following subclass, which implements a "CPS::Governor" subclass that calls "sleep()" between every invocation.
package Governor::Sleep
use base qw( CPS::Governor );
sub new
{
my $class = shift;
my ( $delay ) = @_;
my $self = $class->SUPER::new;
$self->{delay} = $delay;
return $self;
}
sub again
{
my $self = shift;
my $code = shift;
sleep $self->{delay};
# @args are still in @_
goto &$code;
}
SEE ALSO
o Sub::Call::Tail - Tail calls for subroutines and methods
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>
perl v5.14.2 2012-06-27 CPS::Governor(3pm)