Sponsored Content
Top Forums Shell Programming and Scripting Calculate average from CSV file using PERL script Post 302552843 by yazu on Monday 5th of September 2011 10:59:44 PM
Old 09-05-2011
Well, it works for me (Windows XP):
Code:
C:\work>perl -F: -anE "$total += $F[1]; END { say $total/$. }" fps.csv
30.1827114285714

 

10 More Discussions You Might Find Interesting

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

2. Shell Programming and Scripting

Simple Script needed for Processing CSV file perl

I am new to perl, and need a script to pull a CSV file, strip out 2 leading columns, and 2 ending columns, and resave the file in a new location. The file is basic and has less than 10,000 records. Secondly, can I schedule perl scripts to run daily? Can someone provide the basic script to... (1 Reply)
Discussion started by: cobbjob
1 Replies

3. Shell Programming and Scripting

Calculate average of each of position of contents in a huge file

My input: >AAA_100 10 20 50 60 10 100 15 10 >AAA_100 20 20 50 60 20 100 15 10 >AAA_100 10 20 50 60 40 100 15 10 >AAA_100 40 20 50 60 10 100 15 10 . . . My Output 20 20 50 60 20 100 15 10 If I have a long list of file. I want to calculate average of each position inside the contents... (7 Replies)
Discussion started by: patrick87
7 Replies

4. Shell Programming and Scripting

Please do help: Perl Script to pull out rows from a CSV file

I have CSV file that contains data in the format as shown below: ABC, 67, 56, 67, 78, 89, 76, 55 PDR, 85, 83, 83, 72, 82, 89, 83 MPG, 86, 53, 54, 65, 23, 54, 75 .. .. .. .. I want to create a script that will pull out the rows from the above sheet and paste it into another CSV file.... (12 Replies)
Discussion started by: pankajusc
12 Replies

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

6. UNIX Desktop Questions & Answers

Calculate average for rows in a text file

Dear Gurus, I have tab-delimited text files with matrix containing values. The first column is a identifier and other columns have the corresponding values. I would like to calculate the average value (total number/number of entries) for all entries from 2nd column to the last column in row... (3 Replies)
Discussion started by: Unilearn
3 Replies

7. Shell Programming and Scripting

Perl script to modify csv file

Hi Friends, I want to convert a csv file into a ordinary .txt file. I am able to convert but I want the output to look as shown below in the .txt file table findhost= { {"xyz","abc"}, {"rxz","mmz"}, {"vrr","nnz"}, } default={"NONE"} My current perl script #!/usr/bin/env perl... (12 Replies)
Discussion started by: dbashyam
12 Replies

8. Shell Programming and Scripting

How to calculate average of two columns and copy into another file?

Hi, I need help with the awk command. I have a folder with aprox 500 files each one with two columns and I want to print in a new file, the average of column 1 and average of column 2 and the name of each file. Input files are: File-1: 100 99 20 99 50 99 50 99 File-2: 200 85... (3 Replies)
Discussion started by: Lokaps
3 Replies

9. Shell Programming and Scripting

How to calculate avg values of csv file using shell scripting .?

hi all i have a reporting work and i want it to be automated using shell scripting kindly let me know how can i make that possibe . eg data are :... (2 Replies)
Discussion started by: Avinash shaw
2 Replies

10. Shell Programming and Scripting

How to calculate average of csv using shell scripting?

Hi, I need to calculate the average of the following values using shell scripitng. Can anyone please suggest a solution? ... (10 Replies)
Discussion started by: karan pratap si
10 Replies
TOMATOES(6)															       TOMATOES(6)

NAME
tomatoes - Tomatoes smashing game SYNOPSIS
tomatoes SYNOPSIS
I Have No Tomatoes is an extreme leisure time activity idea of which culminates in the following question: How many tomatoes can you smash in ten short minutes? If you have the time to spare, this game has the vegetables just waiting to be eliminated! NOTES
Before starting the game, you should know that the game uses OpenGL for hardware accelerated 2d & 3d graphics. This means that you must have fully OpenGL compatible graphics card in your PC. Your card also needs to be able to use 512x512 textures, and this rules out Voodoo 1, 2 and 3 (limited to 256x256 textures). As for the CPU and memory requirements, I'd recommend something along the lines of Pentium II (or an AMD equivalent) and 64MB. The game works on much slower systems as well, as the game skips frames if the system can't keep up with the 60 FPS rate; this ensures that the game runs at the right speed, you just don't get very smooth animation. This game features solid game play with beautiful OpenGL API driven isometric 3d graphics and nice music. It also includes a MOD player, and you can use your own MOD-type music in the game background. Just copy your XM/S3M/IT/MOD - files to the music subdirectory of I Have No Tomatoes and the game plays them. You can press F1 to skip a song when ingame. There's room for 128 MODs. Btw, if you don't have any MOD music, ModArchive (www.modarchive.com <URL:www.modarchive.com>) is a good place to download some. CONFIGURATION
You may also want to set some options, such as the screen resolution and color depth. By default, I Have No Tomatoes starts fullscreen in 800x600 resolution, 32bpp. To fine-tune the preferences to suit your PC better, open the file config.cfg in a text editor (Notepad will do). Under Unix this file is stored in ~/.tomatoes/. Most likely you'll be interested in these lines: o video_mode = 800 x 600 o video_mode_color_depth = 32 o video_mode_fullscreen = 1 o sound_enabled = 1 To set the resolution, change the video_mode - line (some common resolutions include 640 x 480, 800 x 600, 1024 x 768). Most common color depths are 16 and 32, and sometimes 24. video_mode_fullscreen controls whether the game starts in fullscreen or in a window. When running in windowed mode, you can use any resolution you want (the 4:3 aspect ratio modes are still preferred). If you don't have a sound card (or want to turn the sounds off), set sound_enabled to 0 (zero). Finally, if you want to know how many frames your system draws per second (FPS), set show_fps to 1. FPS should be over 60 for smooth anima- tion. The default keys can be changed from the Options menu in game, so no need change them here. When you're satisfied with the config.cfg settings, by all means, proceed to start the game :) AUTHOR
You can contact the author by email at <lsoft@mbnet.fi>. Notice that since 12th of July, 2004 I've been in the army, so don't expect imme- diate responses. Be patient :) This man page was compiled by Helge Kreutzmann <debian@helgefjell.de> for the GNU/Linux project but it may be used by everybody else as well. SEE ALSO
Tomates homepage: http://tomatoes.sourceforge.net <URL:http://tomatoes.sourceforge.net> tomatoes 23 May 2012 TOMATOES(6)
All times are GMT -4. The time now is 05:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy