Sponsored Content
Operating Systems HP-UX calculate average of multiple line data Post 302198558 by jim mcnamara on Friday 23rd of May 2008 07:33:48 AM
Old 05-23-2008
Code:
awk '{ cnt[$1]++; tot[$1]+$2}
        END{ for (i in tot) { print i, tot[i]/cnt[i]} ' inputfile

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

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... (0 Replies)
Discussion started by: onthetopo
0 Replies

2. Programming

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; (3 Replies)
Discussion started by: cdfd123
3 Replies

3. Shell Programming and Scripting

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... (5 Replies)
Discussion started by: nica
5 Replies

4. Shell Programming and Scripting

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... (4 Replies)
Discussion started by: jaredhanks
4 Replies

5. Shell Programming and Scripting

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... (6 Replies)
Discussion started by: alex2005
6 Replies

6. Shell Programming and Scripting

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 ... (2 Replies)
Discussion started by: AriasFco
2 Replies

7. Shell Programming and Scripting

Calculate average for repeated ID within a data

I have an awk script that gives the following output: Average end-to-end transmission delay 2.7 to 5.7 is 0.635392 seconds Average end-to-end transmission delay 2.1 to 5.1 is 0.66272 seconds Average end-to-end transmission delay 2.1 to 5.1 is 0.691712 seconds Average end-to-end transmission... (4 Replies)
Discussion started by: ENG_MOHD
4 Replies

8. Shell Programming and Scripting

Average of multiple time-stamped data every half hour

Hi All, Thank you for reading through my post and helping me figure out how I would be able to perform this task. For example: I have a list of continuous output collected into a file in the format as seen below: Date...........Time........C....A......... B ==========================... (5 Replies)
Discussion started by: terrychen
5 Replies

9. Shell Programming and Scripting

Calculate Average time of one column

Hello dears, I have a log file with records like below and want to get a average of one column based on the search of one specific keyword. 2015-02-07 08:15:28 10.102.51.100 10.112.55.101 "kevin.c" POST ... (2 Replies)
Discussion started by: Newman
2 Replies

10. Shell Programming and Scripting

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... (1 Reply)
Discussion started by: invinzin21
1 Replies
g_anaeig(1)					 GROMACS suite, VERSION 4.5.4-dev-20110404-bc5695c				       g_anaeig(1)

NAME
g_anaeig - analyzes the eigenvectors VERSION 4.5.4-dev-20110404-bc5695c SYNOPSIS
g_anaeig -v eigenvec.trr -v2 eigenvec2.trr -f traj.xtc -s topol.tpr -n index.ndx -eig eigenval.xvg -eig2 eigenval2.xvg -comp eigcomp.xvg -rmsf eigrmsf.xvg -proj proj.xvg -2d 2dproj.xvg -3d 3dproj.pdb -filt filtered.xtc -extr extreme.pdb -over overlap.xvg -inpr inprod.xpm -[no]h -[no]version -nice int -b time -e time -dt time -tu enum -[no]w -xvg enum -first int -last int -skip int -max real -nframes int -[no]split -[no]entropy -temp real -nevskip int DESCRIPTION
g_anaeig analyzes eigenvectors. The eigenvectors can be of a covariance matrix ( g_covar) or of a Normal Modes analysis ( g_nmeig). When a trajectory is projected on eigenvectors, all structures are fitted to the structure in the eigenvector file, if present, otherwise to the structure in the structure file. When no run input file is supplied, periodicity will not be taken into account. Most analyses are performed on eigenvectors -first to -last, but when -first is set to -1 you will be prompted for a selection. -comp: plot the vector components per atom of eigenvectors -first to -last. -rmsf: plot the RMS fluctuation per atom of eigenvectors -first to -last (requires -eig). -proj: calculate projections of a trajectory on eigenvectors -first to -last. The projections of a trajectory on the eigenvectors of its covariance matrix are called principal components (pc's). It is often useful to check the cosine content of the pc's, since the pc's of random diffusion are cosines with the number of periods equal to half the pc index. The cosine content of the pc's can be calculated with the program g_analyze. -2d: calculate a 2d projection of a trajectory on eigenvectors -first and -last. -3d: calculate a 3d projection of a trajectory on the first three selected eigenvectors. -filt: filter the trajectory to show only the motion along eigenvectors -first to -last. -extr: calculate the two extreme projections along a trajectory on the average structure and interpolate -nframes frames between them, or set your own extremes with -max. The eigenvector -first will be written unless -first and -last have been set explicitly, in which case all eigenvectors will be written to separate files. Chain identifiers will be added when writing a .pdb file with two or three structures (you can use rasmol -nmrpdb to view such a .pdb file). Overlap calculations between covariance analysis: Note: the analysis should use the same fitting structure -over: calculate the subspace overlap of the eigenvectors in file -v2 with eigenvectors -first to -last in file -v. -inpr: calculate a matrix of inner-products between eigenvectors in files -v and -v2. All eigenvectors of both files will be used unless -first and -last have been set explicitly. When -v, -eig, -v2 and -eig2 are given, a single number for the overlap between the covariance matrices is generated. The formulas are: difference = sqrt(tr((sqrt(M1) - sqrt(M2))2)) normalized overlap = 1 - difference/sqrt(tr(M1) + tr(M2)) shape overlap = 1 - sqrt(tr((sqrt(M1/tr(M1)) - sqrt(M2/tr(M2)))2)) where M1 and M2 are the two covariance matrices and tr is the trace of a matrix. The numbers are proportional to the overlap of the square root of the fluctuations. The normalized overlap is the most useful number, it is 1 for identical matrices and 0 when the sampled subspaces are orthogonal. When the -entropy flag is given an entropy estimate will be computed based on the Quasiharmonic approach and based on Schlitter's formula. FILES
-v eigenvec.trr Input Full precision trajectory: trr trj cpt -v2 eigenvec2.trr Input, Opt. Full precision trajectory: trr trj cpt -f traj.xtc Input, Opt. Trajectory: xtc trr trj gro g96 pdb cpt -s topol.tpr Input, Opt. Structure+mass(db): tpr tpb tpa gro g96 pdb -n index.ndx Input, Opt. Index file -eig eigenval.xvg Input, Opt. xvgr/xmgr file -eig2 eigenval2.xvg Input, Opt. xvgr/xmgr file -comp eigcomp.xvg Output, Opt. xvgr/xmgr file -rmsf eigrmsf.xvg Output, Opt. xvgr/xmgr file -proj proj.xvg Output, Opt. xvgr/xmgr file -2d 2dproj.xvg Output, Opt. xvgr/xmgr file -3d 3dproj.pdb Output, Opt. Structure file: gro g96 pdb etc. -filt filtered.xtc Output, Opt. Trajectory: xtc trr trj gro g96 pdb cpt -extr extreme.pdb Output, Opt. Trajectory: xtc trr trj gro g96 pdb cpt -over overlap.xvg Output, Opt. xvgr/xmgr file -inpr inprod.xpm Output, Opt. X PixMap compatible matrix file OTHER OPTIONS
-[no]hno Print help info and quit -[no]versionno Print version info and quit -nice int 19 Set the nicelevel -b time 0 First frame (ps) to read from trajectory -e time 0 Last frame (ps) to read from trajectory -dt time 0 Only use frame when t MOD dt = first time (ps) -tu enum ps Time unit: fs, ps, ns, us, ms or s -[no]wno View output .xvg, .xpm, .eps and .pdb files -xvg enum xmgrace xvg plot formatting: xmgrace, xmgr or none -first int 1 First eigenvector for analysis (-1 is select) -last int 8 Last eigenvector for analysis (-1 is till the last) -skip int 1 Only analyse every nr-th frame -max real 0 Maximum for projection of the eigenvector on the average structure, max=0 gives the extremes -nframes int 2 Number of frames for the extremes output -[no]splitno Split eigenvector projections where time is zero -[no]entropyno Compute entropy according to the Quasiharmonic formula or Schlitter's method. -temp real 298.15 Temperature for entropy calculations -nevskip int 6 Number of eigenvalues to skip when computing the entropy due to the quasi harmonic approximation. When you do a rotational and/or transla- tional fit prior to the covariance analysis, you get 3 or 6 eigenvalues that are very close to zero, and which should not be taken into account when computing the entropy. SEE ALSO
gromacs(7) More information about GROMACS is available at <http://www.gromacs.org/>. Mon 4 Apr 2011 g_anaeig(1)
All times are GMT -4. The time now is 07:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy