## Calculate average for repeated ID within a data

Calculate average for repeated ID within a data
# 1
10-30-2013
Calculate average for repeated ID within a data

I have an awk script that gives the following output:

The time is calculated from (i.e. 2.X ) to (y.z ) where x,y,z could be any number. I have a cases where the same 2.x to the same y.z is repeated with different time value. I need to calculate average time . for example from the above sample we have :
I want the output to be instead :
Average end-to-end transmission delay 2.1 to 5.1 is 1.113433 seconds which is (1.06953+1.09852 +1.12751 +1.15817 )/4.

I want to do that for all of other values.
 ENG_MOHD View Public Profile for ENG_MOHD Find all posts by ENG_MOHD
# 2
10-30-2013
try

 pamu View Public Profile for pamu Find all posts by pamu
# 3
10-30-2013
Yes it works. Thank you ...

One last modifications..How about if I want to calculate the first hit. for example instead of calculating the average, I want to filtered out the repeated occurrences. For example;

The output would be only the first hit;
and ignore the rest repeated occurrences.
 ENG_MOHD View Public Profile for ENG_MOHD Find all posts by ENG_MOHD
# 4
10-30-2013
In that case try:
 Scrutinizer View Public Profile for Scrutinizer Find all posts by Scrutinizer
# 5
10-30-2013
Thanks .. It works
 ENG_MOHD View Public Profile for ENG_MOHD Find all posts by ENG_MOHD

## Calculate the average per block.

My old school way is a one liner. And will search for average from SAR, to get the data receive rate. But, I dont think it is practical or accurate,. Because it calculates to off peak hours. I am planning to change it. My cron runs every 30 mins. When my cron runs, and my time is 14:47pm,, it will...

## Calculate average, azimut and distance

Gents, Please i will to get the distance and azimut from 2 coordinates: Usig excel formula i get the correct values, but i will like to do it using awk. Example A 35089.0 50345.016 9 75 1 2101774 77 70 79 483911.6 2380106.9 137.4 1 1 6 1 A 35089.0 50345.01620 75...

## Calculate Average AWK

I want to calculate the average line by line of some files with several lines on them, the files are identical, just want to average the 3rd columns of those files.:wall: Example file: File 1 001 0.046 0.667267 001 0.047 0.672028 001 0.048 0.656025 001 0.049 ...

## Average for repeated elements in a column

I have a file that looks like this 452 025_E3 8 025_E3 82 025_F5 135 025_F5 5 025_F5 23 025_G2 38 025_G2 71 025_G2 9 026_A12 81 026_A12 10 026_A12 some of the elements in column2 are repeated. I want an output file that will extract the...

## AWK novice - calculate the average

Hi, I have the following data in a file for example: P1 XXXXXXX.1 YYYYYYY.1 ZZZ.1 P1 XXXXXXX.2 YYYYYYY.2 ZZZ.2 P1 XXXXXXX.3 YYYYYYY.3 ZZZ.3 P1 XXXXXXX.4 YYYYYYY.4 ZZZ.4 P1 XXXXXXX.5 YYYYYYY.5 ZZZ.5 P1 XXXXXXX.6 YYYYYYY.6 ZZZ.6 P1 XXXXXXX.7 YYYYYYY.7 ZZZ.7 P1 XXXXXXX.8 YYYYYYY.8 ZZZ.8 P2...

## Calculate average time using a script

Hello, I'm hoping to get some help on calculating an average time from a list of times (hour:minute:second). Here's what my list looks like right now, it will grow (I can get the full date or change the formatting of this as well): 07:55:31 09:42:00 08:09:02 09:15:23 09:27:45 09:49:26...

## calculate the average of time series data using AWK

Hi, I have two time series data (below) merged into a file. t1 and t2 are in unit of second I want to calculate the average of V1 every second and count how many times "1" in V2 is occur within a second Input File: t1 V1 t2 V2 10.000000...

## calculate average

I have a file which is 2 3 4 5 6 6 so i am writing program in C to calculate mean.. #include<stdio.h> #include<string.h> #include <math.h> double CALL mean(int n , double x) main (int argc, char **argv) { char Buf,SEQ; int i; double result = 0; FILE *fp;

## calculate average of multiple line data

I have a question as below and i need to write a shell or perl script for this query:My Input file looks like below RNo Marks 12 50 15 70 18 80 12 40 13 55 18 88 13 75...

## calculate average of column 2

Hi I have fakebook.csv as following: F1(current date) F2(popularity) F3(name of book) F4(release date of book) 2006-06-21,6860,"Harry Potter",2006-12-31 2006-06-22,,"Harry Potter",2006-12-31 2006-06-23,7120,"Harry Potter",2006-12-31 2006-06-24,,"Harry Potter",2006-12-31...