Sponsored Content
Top Forums Shell Programming and Scripting Print root number between min and max ranges Post 302960397 by RudiC on Sunday 15th of November 2015 03:13:57 AM
Old 11-15-2015
Another approach, svp? Try
Code:
awk '{TH=10^int(log($2 - $1)/log(10) + 0.005); for (i=int($1 / TH); i<=int($2 / TH); i++) print i}' file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk to print mon and max values of ranges

HI all I'm trying to write an awk script to print the min and max value in a range(s) contained in another file - the range values are in $2 EG 114,7964,1,y,y,n 114,7965,1,y,y,n 114,7966,1,y,y,n 114,7967,1,y,y,n 114,7969,1,y,y,n 114,7970,1,y,y,n 114,7971,1,y,y,n 114,7972,1,y,y,n... (3 Replies)
Discussion started by: Mudshark
3 Replies

2. Shell Programming and Scripting

min and max value of process id

We are running a AIX 5.2 OS. Would anyone happen to know what the max value for a process id could be? Thanks jerardfjay :) (0 Replies)
Discussion started by: jerardfjay
0 Replies

3. Shell Programming and Scripting

get min, max and average value

hi! i have a file like the attachement. I'd like to get for each line the min, max and average values. (there is 255 values for each line) how can i get that ? i try this, is it right? BEGIN {FS = ","; OFS = ";";max=0;min=0;moy=0;total=0;freq=890} $0 !~ /Trace1:/ { ... (1 Reply)
Discussion started by: riderman
1 Replies

4. Shell Programming and Scripting

print max number of 2 columns - awk

Is it possible to print max number of 2 columns - awk note: print max if the integer is positive and print min if the integer is negative input a 1 2 b 3 4 c 5 1 d -3 -5 d -5 -3 output a 2 b 4 c 5 d -5 d -5 (4 Replies)
Discussion started by: quincyjones
4 Replies

5. UNIX for Dummies Questions & Answers

[Solved] Print a line using a max and a min values of different columns

Hi guys, I already search on the forum but i can't solve this on my own. I have a lot of files like this: And i need to print the line with the maximum value in last column but if the value is the same (2 in this exemple for the 3 last lines) i need get the line with the minimum value in... (4 Replies)
Discussion started by: MetaBolic0
4 Replies

6. Shell Programming and Scripting

Print min and max value from two column

Dear All, I have data like this, input: 1254 10125 1254 10126 1254 10127 1254 10128 1254 10129 1255 10130 1255 10131 1255 10132 1255 10133 1256 10134 1256 10135 1256 10137... (3 Replies)
Discussion started by: aksin
3 Replies

7. Shell Programming and Scripting

Print numbers between two number ranges

Hi, I have a list.txt file with number ranges and want to print/save new all.txt file with all the numbers and between the numbers. == list.txt == 65936 65938 65942 && 65943 65945 ... (7 Replies)
Discussion started by: AK47
7 Replies

8. Shell Programming and Scripting

Number of elements, average value, min & max from a list of numbers using awk

Hi all, I have a list of numbers. I need an awk command to find out the numbers of elements (number of numbers, sort to speak), the average value the min and max value. Reading the list only once, with awk. Any ideas? Thanks! (5 Replies)
Discussion started by: black_fender
5 Replies

9. Programming

Php number array from max, min, step size mysql data

I want to create a form with data values in a dropdown list. The values in the dropdown list need to be generated on the fly from max, min and increment values contained in a mysql database. Hopefully this makes sense, I really have no idea where to start :confused: Thanks (6 Replies)
Discussion started by: barrydocks
6 Replies

10. UNIX for Beginners Questions & Answers

Print a row with the max number in a column

Hello, I have this table: chr1_16857_17742 - chr1 17369 17436 "ENST00000619216.1"; "MIR6859-1"; - 67 chr1_16857_17742 - chr1 14404 29570 "ENST00000488147.1"; "WASH7P"; - 885 chr1_16857_18061 - chr1 ... (5 Replies)
Discussion started by: coppuca
5 Replies
Bio::Range(3pm) 					User Contributed Perl Documentation					   Bio::Range(3pm)

NAME
Bio::Range - Pure perl RangeI implementation SYNOPSIS
$range = Bio::Range->new(-start=>10, -end=>30, -strand=>+1); $r2 = Bio::Range->new(-start=>15, -end=>200, -strand=>+1); print join(', ', $range->union($r2)), " "; print join(', ', $range->intersection($r2)), " "; print $range->overlaps($r2), " "; print $range->contains($r2), " "; DESCRIPTION
This provides a pure perl implementation of the BioPerl range interface. Ranges are modeled as having (start, end, length, strand). They use Bio-coordinates - all points >= start and <= end are within the range. End is always greater-than or equal-to start, and length is greather than or equal to 1. The behaviour of a range is undefined if ranges with negative numbers or zero are used. So, in summary: length = end - start + 1 end >= start strand = (-1 | 0 | +1) FEEDBACK
Mailing Lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists Support Please direct usage questions or support issues to the mailing list: bioperl-l@bioperl.org rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. Reporting Bugs Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ AUTHOR - Heikki Lehvaslaiho Email heikki-at-bioperl-dot-org APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ Constructors new Title : new Usage : $range = Bio::Range->new(-start => 100, -end=> 200, -strand = +1); Function: generates a new Bio::Range Returns : a new range Args : -strand (defaults to 0) and any two of (-start, -end, -length), the third will be calculated unions Title : unions Usage : @unions = Bio::Range->unions(@ranges); Function: generate a list of non-intersecting Bio::Range objects from a list of Bio::Range objects which may intersect Returns : a list of Bio::Range objects Args : a list of Bio::Range objects Member variable access These methods let you get at and set the member variables start Title : start Function : return or set the start co-ordinate Example : $s = $range->start(); $range->start(7); Returns : the value of the start co-ordinate Args : optionally, the new start co-ordinate Overrides: Bio::RangeI::start end Title : end Function : return or set the end co-ordinate Example : $e = $range->end(); $range->end(2000); Returns : the value of the end co-ordinate Args : optionally, the new end co-ordinate Overrides: Bio::RangeI::end strand Title : strand Function : return or set the strandedness Example : $st = $range->strand(); $range->strand(-1); Returns : the value of the strandedness (-1, 0 or 1) Args : optionally, the new strand - (-1, 0, 1) or (-, ., +). Overrides: Bio::RangeI::strand length Title : length Function : returns the length of this range Example : $length = $range->length(); Returns : the length of this range, equal to end - start + 1 Args : if you attempt to set the length an exception will be thrown Overrides: Bio::RangeI::Length toString Title : toString Function: stringifies this range Example : print $range->toString(), " "; Returns : a string representation of this range Boolean Methods These methods return true or false. $range->overlaps($otherRange) && print "Ranges overlap "; overlaps Title : overlaps Usage : if($r1->overlaps($r2)) { do stuff } Function : tests if $r2 overlaps $r1 Args : a range to test for overlap with Returns : true if the ranges overlap, false otherwise Inherited: Bio::RangeI contains Title : contains Usage : if($r1->contains($r2) { do stuff } Function : tests whether $r1 totally contains $r2 Args : a range to test for being contained Returns : true if the argument is totally contained within this range Inherited: Bio::RangeI equals Title : equals Usage : if($r1->equals($r2)) Function : test whether $r1 has the same start, end, length as $r2 Args : a range to test for equality Returns : true if they are describing the same range Inherited: Bio::RangeI Geometrical methods These methods do things to the geometry of ranges, and return triplets (start, end, strand) from which new ranges could be built. intersection Title : intersection Usage : ($start, $stop, $strand) = $r1->intersection($r2) Function : gives the range that is contained by both ranges Args : a range to compare this one to Returns : nothing if they do not overlap, or the range that they do overlap Inherited: Bio::RangeI::intersection union Title : union Usage : ($start, $stop, $strand) = $r1->union($r2); : ($start, $stop, $strand) = Bio::Range->union(@ranges); Function : finds the minimal range that contains all of the ranges Args : a range or list of ranges Returns : the range containing all of the ranges Inherited: Bio::RangeI::union perl v5.14.2 2012-03-02 Bio::Range(3pm)
All times are GMT -4. The time now is 08:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy