Hi,
I want to write a shell script which increments a particular column in a row from a text file and then adds another row below the current row with the incremented value .
For Eg .
if the input file has a row :
abc xyz lmn 89 lm nk o p
I would like the script to create something like... (9 Replies)
Hello,
I have an input file like the following:
11_3_4
2_1_35
3_15__
_16989
Where '_' is a space. The data is in a table. Is there a way for the program to prompt the user for x1,y1 and x2,y2, where x1,y1 is the desired number (for example x=6 y=4 is a value of 4) and move to a desired spot... (2 Replies)
Hi, Please read the whole thread.
I have been working on this script below. It works fine, feel free to copy and test with the INPUT File below as well.
example:
PACKET DATA PROTOCOL CONTEXT DATA
APNID PDPADD EQOSID VPAA PDPCH PDPTY PDPID
10 ... (6 Replies)
Hi Friends,
I have a single column data like below.
1
2
3
4
5
I need the output like below.
0
1
2
3
4
where each row (including first row) subtracting from first row and the result should print below like the way shown in output file.
Thanks
Sid (11 Replies)
Hi ,
Can anyone help me suggesting - how to do the below trick with awk
Input
120
130
140
210
310
410
645
729
800
Output
120 130 140 (6 Replies)
Discussion started by: Indra2011
6 Replies
LEARN ABOUT DEBIAN
number::range
Number::Range(3pm) User Contributed Perl Documentation Number::Range(3pm)NAME
Number::Range - Perl extension defining ranges of numbers and testing if a number is found in the range. You can also add and delete from
this range.
SYNOPSIS
use Number::Range;
my $range = Number::Range->new("-10..10,12,100..120");
if ($range->inrange("13")) {
print "In range
";
} else {
print "Not in range
";
}
$range->addrange("200..300");
$range->delrange("250..255");
my $format = $range->range;
# $format will be '-10..10,12,100..120,200..249,256..300'
DESCRIPTION
Number::Range will take a description of a range, and then allow you to test on if a number falls within the range. You can also add and
delete from the range.
RANGE FORMAT
The format used for range is pretty straight forward. To separate sections of ranges it uses a "," or whitespace. To create the range, it
uses ".." to do this, much like Perl's own binary ".." range operator in list context.
METHODS
new
$range = Number::Range->new("10..20","25..30");
Creates the range object. It will accept any number of ranges as its input.
addrange
$range->addrange("22");
This will also take any number of ranges as input and add them to the existing range.
delrange
$range->delrange("10");
This will also take any number of ranges as input and delete them from the existing range.
inrange
$range->inrange("26"); my @results = $range->inrange("27","200");
This will take one or more numbers and check if each of them exists in the range. If passed a list, and in array context, it will
return a list of 0's or 1's, depending if that one was true or false in the list position. If in scalar context, it will return a
single 1 if all are true, or a single 0 if one of them failed.
range
$format = $range->range; @numbers = $range->range;
Depending on context this will return either an array of all the numbers found in the range, for list context. For scalar context it
will return a range string.
size
$size = $range->size;
This will return the total number of entries in the range.
EXPORT
None by default.
SEE ALSO
Number::Tolerant, Tie::RangeHash, and Array::IntSpan for similar modules.
AUTHOR
Larry Shatzer, Jr., <larrysh@cpan.org>
COPYRIGHT AND LICENSE
Copyright (C) 2004-12 by Larry Shatzer, Jr.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2012-06-20 Number::Range(3pm)