Ok I'm really confused. This is my code and everything works up to the case statement where for some reason it isn't even reading it. When I run the script it just stops after the echo $AGE line.
Any ideas?
Last edited by rbatte1; 09-16-2016 at 08:15 AM..
Reason: Added CODE tags
Hi im new to unix and need to find a way to grep the top 5 numbers in a file and put them into another file. For example my file looks like this
abcdef 50000
abcdef 45000
abcdef 40000
abcdef 35000
abcdef 30000
abcdef 25000
abcdef 20000
abcdef 15000
abcdef 10000
and so on...
How can... (1 Reply)
Howdy experts,
We have some ranges of number which belongs to particual group as below.
GroupNo StartRange EndRange
Group0125 935300 935399
Group2006 935400 935476
937430 937459
Group0324 935477 935549
... (6 Replies)
Complete Unix beginner here. I basically have this script -
This seems to work fine. I want to try and shorten it by making it something like this -
This isn't working. I think it's probably to do with the zero padding that `date +%H` gives me, but if I use `date +%k`, I get a space at... (3 Replies)
Hello,
I have a column where there are values from 1 to 150.
I want to get the frequency of values in the following ranges:
1-5
6-10
11-15
....
....
....
146-150
How can I do this in a for loop?
Thanks,
Guss (1 Reply)
Dear Friends,
I want to know how to grep for the lines that has a number between given range(start and end).
I have tried the following sed command.
sed -n -e '/20030101011442/,/20030101035519/p'
However this requires both start and end to be part of the content being grepped. However... (4 Replies)
I am trying to extract specific information from a large *.sam file (it's originally 28Gb).
I want to extract all lines that are on chr3 somewhere in the range of 112,937,439-113,437,438.
Here is a sample line from my file so you can get a feel for what each line looks like:
seq.4 0 ... (8 Replies)
Hi,
I'm trying to match a filename that could be called anything from vout001 to vout252 and was trying to do a small test but I'm not getting the result I thought I would..
Can some one tell me what I'm doing wrong?
*****@********>echo $mynumber ... (4 Replies)
Hi
I am getting an argument which specifies the range of numbers. eg: 7-15
Is there a way that i can easily (avoiding loop) print the range of number between and including the specified above.
The above example should translate to 7,8,9,10,11,12,13,14,15 (3 Replies)
Discussion started by: tostay2003
3 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)