Sponsored Content
Top Forums Shell Programming and Scripting Computing average values from multiple text files Post 302543526 by rbredereck on Monday 1st of August 2011 06:25:17 AM
Old 08-01-2011
Thanks

It works perfectly! Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Average of elements throught multiple files

Hi, I got a lot of files looking like this: 1 0.5 6 All together there are ard 1'000'000 lines in each of the ard 100 files. I want to build the average for every line, and write the result to a new file. The averaging should start at a specific line, here for example at line... (10 Replies)
Discussion started by: chillmaster
10 Replies

2. Shell Programming and Scripting

Help in extracting multiple files and taking average at same time

Hi, I have 20 files which have respective 50 lines with different values. I would like to process each line of the 50 lines in these 20 files one at a time and do an average of 3rd field ($3) of these 20 files. This will be output to an output file. Instead of using join to generate whole... (8 Replies)
Discussion started by: ahjiefreak
8 Replies

3. UNIX Desktop Questions & Answers

How do you [e]grep for multiple values within multiple files?

Hi I'm sure there's a way to do this, but I ran out of caffeine/talent before getting the answer in a long winded alternate way (don't ask ;) ) The task I was trying to do was scan a directory of files and show only files that contained 3 values: I940 5433309 2181 I tried many variations... (4 Replies)
Discussion started by: callumw
4 Replies

4. Shell Programming and Scripting

Computing average and standard deviation from multiple text files

Hello there, I found an elegant solution to computing average values from multiple text files awk '{for (i=1;i<=NF;i++){if ($i!~"n/a"){a+=$i}else{b++}}}END{for (i=1;i<=FNR;i++){for (j=1;j<=NF;j++){printf (a/(3-b))((b>0)?"~"b" ":" ")};printf "\n"}}' file1 file2 file3 I tried to modify... (2 Replies)
Discussion started by: charmmilein
2 Replies

5. Shell Programming and Scripting

Average of a column in multiple files

I have several sequential files with name stat.1000, stat.1001....to stat.1020 with a format like this 0.01 1 3822 4.97379915032e-14 4.96982253992e-09 0 0.01 3822 1 4.97379915032e-14 4.96982253992e-09 0 0.01 2 502 0.00993165137406 993.165137406 0 0.01 502 2 0.00993165137406 993.165137406 0... (6 Replies)
Discussion started by: kayak
6 Replies

6. UNIX for Dummies Questions & Answers

Computing for linearly-interpolated values using awk

Hi, I want to compute for linearly-interpolated values for my data using awk, any help is highly appreciated. How do I apply the linear interpolation formula to my data in awk given the equation below: x y 15 0 25 0.1633611 35 0.0741623 desired output: linear interpolation at... (4 Replies)
Discussion started by: ida1215
4 Replies

7. Shell Programming and Scripting

Read record from the text file contain multiple separated values & assign those values to variables

I have a file containing multiple values, some of them are pipe separated which are to be read as separate values and some of them are single value all are these need to store in variables. I need to read this file which is an input to my script Config.txt file name, first path, second... (7 Replies)
Discussion started by: ketanraut
7 Replies

8. Shell Programming and Scripting

Match first two columns and average third from multiple files

I have the following format of input from multiple files File 1 24.01 -81.01 1.0 24.02 -81.02 5.0 24.03 -81.03 0.0 File 2 24.01 -81.01 2.0 24.02 -81.02 -5.0 24.03 -81.03 10.0 I need to scan through the files and when the first 2 columns match I... (18 Replies)
Discussion started by: ncwxpanther
18 Replies

9. Shell Programming and Scripting

Extracting values based on line-column numbers from multiple text files

Dear All, I have to solve the following problems with multiple tab-separated text file but I don't know how. Any help would be greatly appreciated. I have access to Linux mint (but not as a professional). I have multiple tab-delimited files with the following structure: file1: 1 44 2 ... (5 Replies)
Discussion started by: Bastami
5 Replies

10. UNIX for Beginners Questions & Answers

awk GSUB read field values from multiple text files

My program run without error. The problem I am having. The program isn't outputting field values with the column headers to file.txt. Each of the column headers in file.txt has no data. MEMSIZE SECOND SASFoundation Filename The output results in file.txt should show: ... (1 Reply)
Discussion started by: dellanicholson
1 Replies
Module::Starter::Smart(3pm)				User Contributed Perl Documentation			       Module::Starter::Smart(3pm)

NAME
Module::Starter::Smart - A Module::Starter plugin for adding new modules into an existing distribution VERSION
version 0.0.4 SYNOPSIS
use Module::Starter qw/Module::Starter::Smart/; Module::Starter->create_distro(%args); # or in ~/.module-starter/config plugin: Module::Starter::Smart # create a new distribution named 'Foo-Bar' $ module-starter --module=Foo::Bar # ... then add a new module $ module-starter --module=Foo::Bar::Me --distro=Foo-Bar DESCRIPTION
Module::Starter::Smart is a simple helper plugin for Module::Starter. It subclasses Module::Starter::Simple and provides its own implementatoin for several file creation subroutines, such as "create_distro", "create_modules", "create_t", and so on. These new implementations were designed to work with existing distributions. When invoked, the plugin checks if the distribution is already created. If so, the plugin would bypass "create_basedir") and go ahead pull in all the existing modules and test files; these information would be used later in the corresponding file creation subroutines for skipping already-created files. UPDATE: This plugin only covers the simplest use cases. For advanced usage, check out Module::Starter::AddModule. Example Say you have an existing distro, Goof-Ball, and you want to add a new module, Goof::Troop. % ls -R Goof-Ball Build.PL Changes MANIFEST README lib/ t/ Goof-Ball/lib: Goof/ Goof-Ball/lib/Goof: Ball.pm Goof-Ball/t: 00.load.t perlcritic.t pod-coverage.t pod.t Go to the directory containing your existing distribution and run module-starter, giving it the names of the existing distribution and the new module: % module-starter --distro=Goof-Ball --module=Goof::Troop Created starter directories and files % ls -R Goof-Ball Build.PL Changes MANIFEST README lib/ t/ Goof-Ball/lib: Goof/ Goof-Ball/lib/Goof: Ball.pm Troop.pm Goof-Ball/t: 00.load.t perlcritic.t pod-coverage.t pod.t Troop.pm has been added to Goof-Ball/lib/Goof. INTERFACE
No public methods. The module works by subclassing Module::Starter::Simple and rewiring its internal behaviors. DEPENDENCIES
Module::Starter::Smart subclasses Module::Starter::Simple. INCOMPATIBILITIES
The plugin works perfectly with other template plugins, i.e. Module::Starter::PBP (I started using it to develop this module) BUGS AND LIMITATIONS
Please report any bugs or feature requests to "bug-module-starter-smart@rt.cpan.org", or through the web interface at <http://rt.cpan.org>. ACKNOWLEDGEMENT
Special thanks to David Messina, who kindly contributes the example. AUTHOR
Ruey-Cheng Chen "<rueycheng@gmail.com>" LICENCE AND COPYRIGHT
Copyright (c) 2006, 2012 Ruey-Cheng Chen "<rueycheng@gmail.com>". All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic. DISCLAIMER OF WARRANTY
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. perl v5.14.2 2012-03-29 Module::Starter::Smart(3pm)
All times are GMT -4. The time now is 08:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy