Sponsored Content
Top Forums Shell Programming and Scripting Number of elements, average value, min & max from a list of numbers using awk Post 302729115 by black_fender on Friday 9th of November 2012 04:34:07 AM
Old 11-09-2012
Quote:
Originally Posted by elixir_sinari
Oops, I must've been sleeping when I wrote that!!!
Corrected and the required changes done in my earlier post.
Thanks a lot!
You've saved my lazy ass again :P
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Awk search for max and min field values

hi, i have an awk script and I managed to figure out how to search the max value but Im having difficulty in searching for the min field value. BEGIN {FS=","; max=0} NF == 7 {if (max < $6) max = $6;} END { print man, min} where $6 is the column of a field separated by a comma (3 Replies)
Discussion started by: Kirichiko
3 Replies

2. 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

3. Shell Programming and Scripting

Count time min/max/average for ping

I am redirecting my ping output to a file. The sample output is like this: 64 bytes from xx.xx.xx.167: icmp_seq=4490 ttl=116 3.75 ms 2011Jul12- 15 40 16 64 bytes from xx.xx.xx.167: icmp_seq=4491 ttl=116 5.29 ms 2011Jul12- 15 40 17 64 bytes from xx.xx.xx.167: icmp_seq=4492 ttl=116 4.88 ms... (6 Replies)
Discussion started by: zorrox
6 Replies

4. Shell Programming and Scripting

How to find the average,min,max ,total count?

Hi , Below is my sample data,I have this 8 column(A,B,C,D,E,F,G,H) in csv file. A , B ,C ,D ,E ,F,G ,H 4141,127337,24,15,20,69,72.0,-3 4141,128864,24,15,20,65,66.0,-1 4141,910053,24,15,4,4,5.0,-1 4141,910383,24,15,22,3,4.0,-1 4141,496969,24,15,14,6,-24.0,-18... (7 Replies)
Discussion started by: vinothsekark
7 Replies

5. Shell Programming and Scripting

Average, min and max in file with header, using awk

Hi, I have a file which looks like this: FID IID MISS_PHENO N_MISS N_GENO F_MISS 12AB43131 12AB43131 N 17774 906341 0.01961 65HJ87451 65HJ87451 N 10149 906341 0.0112 43JJ21345 43JJ21345 N 2826 906341 0.003118I would... (11 Replies)
Discussion started by: kayakj
11 Replies

6. Shell Programming and Scripting

Get the min avg and max with awk

aaa: 3 ms aaa: 2 ms aaa: 5 ms aaa: 10 ms .......... to get the 3 2 5 10 ...'s min avg and max something like min: 2 ms avg: 5 ms max: 10 ms (2 Replies)
Discussion started by: yanglei_fage
2 Replies

7. Shell Programming and Scripting

awk script to find min and max value

I need to find the max/min of columns 1 and 2 of a 2 column file what contains the special character ">". I know that this will find the max value of column 1. awk 'BEGIN {max = 0} {if ($1>max) max=$1} END {print max}' input.file But what if I needed to ignore special characters in the... (3 Replies)
Discussion started by: ncwxpanther
3 Replies

8. Shell Programming and Scripting

How to get min and max values using awk?

Hi, I need your kind help to get min and max values from file based on value in $5 . File1 SP12.3 stc 2240806 2240808 + ID1_N003 ID2_N003T0 SP12.3 sto 2241682 2241684 + ID1_N003 ID2_N003T0 SP12.3 XE 2239943 2240011 + ID1_N003 ID2_N003T0 SP12.3 XE 2240077 2241254 + ID1_N003 ... (12 Replies)
Discussion started by: redse171
12 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. Shell Programming and Scripting

Print root number between min and max ranges

Hi to all, Please help on the following problem, I'm not where to begin, if awk or shell script. I have pairs of ranges of numbers and I need to find the root or roots of ranges based on min Range and Max ranges Example #1: If min range is 120000 and max ranges 124999, it means that are... (5 Replies)
Discussion started by: Ophiuchus
5 Replies
Mojo::Exception(3pm)					User Contributed Perl Documentation				      Mojo::Exception(3pm)

NAME
Mojo::Exception - Exceptions with context SYNOPSIS
use Mojo::Exception; my $e = Mojo::Exception->new; DESCRIPTION
Mojo::Exception is a container for exceptions with context information. ATTRIBUTES
Mojo::Exception implements the following attributes. "frames" my $frames = $e->frames; $e = $e->frames($frames); Stacktrace. "line" my $line = $e->line; $e = $e->line([3, 'foo']); The line where the exception occured. "lines_after" my $lines = $e->lines_after; $e = $e->lines_after([[1, 'bar'], [2, 'baz']]); Lines after the line where the exception occured. "lines_before" my $lines = $e->lines_before; $e = $e->lines_before([[4, 'bar'], [5, 'baz']]); Lines before the line where the exception occured. "message" my $message = $e->message; $e = $e->message('Oops!'); Exception message. "raw_message" my $message = $e->raw_message; $e = $e->raw_message('Oops!'); Raw unprocessed exception message. "verbose" my $verbose = $e->verbose; $e = $e->verbose(1); Activate verbose rendering, defaults to the value of "MOJO_EXCEPTION_VERBOSE" or 0. METHODS
Mojo::Exception inherits all methods from Mojo::Base and implements the following new ones. "new" my $e = Mojo::Exception->new('Oops!'); my $e = Mojo::Exception->new('Oops!', $files, $name); Construct a new Mojo::Exception object. "throw" Mojo::Exception->throw('Oops!'); Mojo::Exception->throw('Oops!', $files, $name); Throw exception with stacktrace. "to_string" my $string = $e->to_string; my $string = "$e"; Render exception with context. "trace" $e = $e->trace; $e = $e->trace(2); Store stacktrace. SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>. perl v5.14.2 2012-09-05 Mojo::Exception(3pm)
All times are GMT -4. The time now is 06:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy