Sponsored Content
Top Forums Shell Programming and Scripting Calculate average of top n% of values - UNIX Post 302902619 by vgersh99 on Wednesday 21st of May 2014 11:19:03 AM
Old 05-21-2014
you have ^M-s in your file - probably from ftp-ing from the Windows box.
Get rid of ^M-s in BOTH files and re-run the script, e.g. tr -d '\015' < file2 >file2_new
 

8 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 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

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

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

6. Shell Programming and Scripting

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

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

8. UNIX for Beginners Questions & Answers

Calculate average from a given set of keys and values

Hello, I am writing a script which expects as its input a hash with student names as the keys and marks as the values. The script then returns array of average marks for student scored 60-70, 70-80, and over 90. Output expected 50-70 1 70-90 3 over 90 0 The test script so far... (4 Replies)
Discussion started by: nans
4 Replies
animate(1gv)							  Geomview Module						      animate(1gv)

NAME
animate - animate a sequence of geomview files SYNOPSIS
animate [-p] [-b] [-s speed] [-o] [-S script] [-hide] [-f file1 file2 ...] DESCRIPTION
Animate is an interactive animation tool specifically designed to be used with Geomview. It provides several simple animation controls such as looping, bouncing, and single frame stepping, as well as adjustable speed playing. The program works by telling geomview to read in a sequence of geomview files and then telling geomview to display each frame of the sequence in order. There are two methods that Animate provides for specifying which frames one wants to have in the sequence being viewed. The first method is to enter the name of every frame into the text input box and press return or click on load. The name of each frame must correspond with the name of a geomview file existing in the file system. EXAMPLES pict1 pict2 pict3 pict4 pict* pic?? The second method of loading frames is to first create an animation script file outside of animate and then load the script in by typing its name in the input box and clicking on the script button. The advantage of this method is that you can more easily specify the exact order in which you want the frames to be shown. The format of the script file is a list of frame names each followed by a newline. Comments prepended by a # sign are allowed. EXAMPLE SCRIPT FILE # list of frames for # my rotating cube movie cube.02 cube.04 cube.03 # get rid of this frame later cube.01 . . . cube.90 Loading frames into memory may take a little time, especially if each frame is a particularly large file. Be sure the machine you're using has sufficient memory to load all the frames you desire. Once all frames have been loaded, an 'animate' object will appear in the geomview object browser. It is now possible to begin animating. Scrolling through frames can be accomplished in several different ways. The first, and most obvious way is by 'playing' the frames. Click- ing on the Play button causes animate to begin playing through the frames in order, starting with the first frame or whichever frame has been selected. The corresponding name of each frame being shown is shown in the pink text-entry box. Click on Stop to cease playing. Animation speed depends on the size and complexity of the object in each frame. Thus different sequences can have considerably different top playing speeds. Use the Speed slider to set an upper limit to the animation rate. You can also play slowly through the frames can also by clicking repeatedly on either step button. Press the Bounce button to enter bounce mode. While in bounce mode, direction of play reverses whenever the first or last frame is reached. Clicking on either Step button determines the playing direction. Clicking on Once puts animate in 'once' mode. While in this mode, upon reaching the first or last frame (depending on which direction you are going) of a specified sequence, animate will stop playing. Normal playing can be resumed by clicking on Once again to exit this mode. The Info button will bring up a short menu containing helpful hints for program usage. Clicking on the exit button will cause the program to exit. OPTIONS
-p Start playing through the frames right away upon startup. -b Go into bounce mode upon startup. -s speed Set the speed of play upon startup. The value of speed may be an integer between 0 and 100 which roughly signifies the percentage of top playing speed. -o Set animation to play through only once upon startup. -S script Specify name of script containing filenames for objects to be read in upon startup. Takes precedence over -f option if present. -hide Makes animate invisible upon startup. *Warning* all animate commands must be specified on the command line when this option is used since there is no way to access the main window. -f file1 file2 ... Specify names of files containing objects to be read in upon startup. BUGS
When loading sequences one after another, geomview will often not load a sequence on the first try. This can often be remedied by telling animate to load the sequence yet again. SEE ALSO
geomview(1) oogl(5) AUTHOR
Daeron Meyer The Geometry Center December 12, 1994 animate(1gv)
All times are GMT -4. The time now is 06:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy