11-25-2009
need an AWK code: put in parallel & average them
Hi,
I have a data as follow:
1, 1.0 4.00
1, 2.0 4.00
1, 3.0 4.43
1, 4.0 4.40
1, 5.0 4.48
2, 1.0 0.00
2, 2.0 4.40
2, 3.0 3.40
2, 4.0 4.40
2, 5.0 1.47
3, 1.0 1.00
3, 2.0 3.40
3, 3.0 2.40
3, 4.0 2.40
3, 5.0 2.40
I want to print out in parallel:
1.0 4.00 0.00 1.00
2.0 4.00 4.40 3.40
3.0 4.43 3.40 2.40
4.0 4.40 4.40 2.40
5.0 4.48 1.47 2.40
Then, average each line (desired output):
1.0 1.66
2.0 3.93
3.0 3.41
4.0 3.73
5.0 2.78
Please, let me know how to write an AWK code to do above job.
Thanks
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have the data like this
$1 $2
1 12
2 13
3 14
4 12
5 12
6 12
7 13
8 14
9 12
10 12
i want to compute average of $1 and $2 every 5th line (1-5 and 6-10)
Please help me with awk
Thank you (4 Replies)
Discussion started by: saint2006
4 Replies
2. Shell Programming and Scripting
Hi
I am looking for an awk script which can compute average of all the fields every 5th line. The file looks:
A B C D E F G H I J K L M
1 18 13 14 12 14 13 11 12 12 15 15 15
2 17 17 13 13 13 12 12 11 12 14 15 14
3 16 16 12 12 12 11 11 12 11 16 14 13
4 15 15 11 11 11 12 11 12 11... (6 Replies)
Discussion started by: saint2006
6 Replies
3. UNIX for Dummies Questions & Answers
ignore (2 Replies)
Discussion started by: hairytorus
2 Replies
4. UNIX for Dummies Questions & Answers
SCO v5.0.6
I figured out what command lines I need to get SSH working, but where do I put these command lines so they stick when booting?
#ifconfig net0 ... netmask ... up
#route add default ...
I know I can add the default gateway to /etc/default/tcp, but...
I would rather run a... (2 Replies)
Discussion started by: vdi_jeanne
2 Replies
5. Shell Programming and Scripting
Hi Friends,
I have many files like below.
total,0.7%,0.0%,0.2%,0.0%,0.2%,0.7%,98.0%
total,1.9%,0.0%,0.4%,0.0%,0.0%,6.8%,90.6%
total,0.9%,0.0%,0.4%,0.0%,0.0%,0.0%,98.5%
total,1.4%,0.0%,0.7%,0.0%,0.2%,2.9%,94.5%
total,0.7%,0.0%,0.4%,0.0%,0.0%,0.9%,97.7%... (13 Replies)
Discussion started by: SunilB2011
13 Replies
6. Shell Programming and Scripting
Hi Guys,
Can someone please help me on adding/inserting a variable date to an sql scipt? Basically I want to assign a 7 days date range. As shown below..
#!/usr/bin/perl
use strict;
use Env qw(ORACLE_HOME);
my $SQLPLUS='/opt/oracle/product/10.1.0/db_1/bin/sqlplus -S... (1 Reply)
Discussion started by: pinpe
1 Replies
7. Shell Programming and Scripting
Hi All,
I got stuck up with shell script where i use awk. The scenario which i am working on is as below.
I have a file text.txt with contents
COL1 COL2 COL3 COL4
1 A 500 200
1 B 500 300
2 A 290 150
2 B 290 140
3 C 100 100
I could able to sum col 3 and col4 based on col1 using... (1 Reply)
Discussion started by: imsularif
1 Replies
8. Shell Programming and Scripting
I need to find the average from a file like:
data => BW:123 M:30 RTD:0 1 0 1 0 0 1 1 1 1 0 0 1 1 0'
data => BW:123 N:30 RTD:0 1 0 1 0 0 1 1 1 1 0 0 1 1 0'
data => BW:123 N:30 RTD:0 1 0 1 0 0 1 1 1 1 0 0 1 1 0'
data => BW:123 N:30 RTD:0 1 0 1 0 0 1 1 1 1 0 0 1 1 0'
data => BW:123 N:30 RTD:0 1... (4 Replies)
Discussion started by: Slagle
4 Replies
9. Shell Programming and Scripting
Hi all,
I have a list of numbers. I need an awk command to find out the numbers of elements (number of numbers, sort to speak), the average value the min and max value. Reading the list only once, with awk.
Any ideas?
Thanks! (5 Replies)
Discussion started by: black_fender
5 Replies
10. Solaris
need to capture the following data on an hourly basis without cronjob scheduling in Solaris 5.10/5.11:-
1. load averages
2. Total no. of processes.
3. CPU state
4. Memory
5. Top 3 process details.
any other third-party tool is available? (7 Replies)
Discussion started by: thoranam
7 Replies
LEARN ABOUT DEBIAN
globus-job-cancel
GLOBUS-JOB-CANCEL(1) GRAM5 Commands GLOBUS-JOB-CANCEL(1)
NAME
globus-job-cancel - Cancel a GRAM batch job
SYNOPSIS
globus-job-cancel [-f | -force] [-q | -quiet] JOBID
globus-job-cancel [-help] [-usage] [-version] [-versions]
DESCRIPTION
The globus-job-cancel program cancels the job named by JOBID. Any cached files associated with the job will remain until globus-job-clean
is executed for the job.
By default, globus-job-cancel prompts the user prior to canceling the job. This behavior can be overridden by specifying the -f or -force
command-line options.
OPTIONS
The full set of options to globus-job-cancel are:
-help, -usage
Display a help message to standard error and exit.
-version
Display the software version of the globus-job-cancel program to standard output.
-version
Display the software version of the globus-job-cancel program including DiRT information to standard output.
-force, -f
Do not prompt to confirm job cancel and clean-up.
-quiet, -q
Do not print diagnostics for succesful cancel. Implies -f
ENVIRONMENT
If the following variables affect the execution of globus-job-cancel.
X509_USER_PROXY
Path to proxy credential.
X509_CERT_DIR
Path to trusted certificate directory.
University of Chicago 03/18/2010 GLOBUS-JOB-CANCEL(1)