Has anyone figured out yet how to do pivot table averages using AWK. I didn't see anything with regards to doing averages.
For example, suppose you have the following table with various individuals and their scores in round1 and round2:
Code:
SAMPLE SCORE1 SCORE2
British 15 19.5
British 7 9.1
British 8 10.4
British 11 14.3
German 6 7.8
German 7 9.1
Italian 10 13
Italian 3 3.9
Italian 19 24.7
Italian 9 11.7
Italian 6 7.8
The objective is to do a pivot table using Awk to calculate the average scores by country such as shown in the output below.
Code:
POPULATION AVG SCORE1 AVG SCORE2
British 10.25 13.33
German 6.50 8.45
Italian 9.40 12.22
Hello everyone,
I would like to use awk to parse a file with three columns in, like:
monday 0 1
monday 1 1
monday 2 1
monday 3 1
monday 4 1
monday 5 1
tuesday 0 5
tuesday 1 1
tuesday 2 1
tuesday 3 1
tuesday 4 1
wednesday 0 1
monday 5 25
they represent the day the hour and the... (2 Replies)
I would like to use awk to parse a file with three columns in, like:
Chennai,01,1
Chennai,07,1
Chennai,08,3
Chennai,09,6
Chennai,10,12
Chennai,11,19
Chennai,12,10
Chennai,13,12
Kerala,09,2
AP,10,1
AP,11,1
Delhi,13,1
Kerala,13,3
Chennai,00,3
Chennai,01,1
Chennai,02,1
Chennai,07,5 (3 Replies)
Hi,
I have a file with more than 2,000 rows like this:
05/26/2011,1200,1500
I would like to create a awk shell script that calculate the price average of the second and third field each 5,10 and 20 rows or ask me for the values, starting at first row.
Finally compare the average value... (1 Reply)
Hello,
I need some help to reformat this table-by-row to matrix?
infile:
site1 A:o,p,q,r,s,t
site1 C:y,u
site1 T:v,w
site1 -:x,z
site2 A:p,r,t,v,w,z
site2 C:u,y
site2 G:q,s
site2 -:o,x
site3 A:o,q,s,t,u,z
site3 C:y
site3 T:v,w,x
site3 -:p,routfile:
SITE o p q r s t v u w x y... (7 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Write an awk script(company.awk) for the workers file to find the number of workers of each departman, total... (8 Replies)
Hello everyone
I have a 20M file which is having the below sample layout
1111,ABC,100
1111,DEF,200
1111,XYZ,300
4444,LMN,100
4444,AKH,500
4444,WCD,400
2222,ABC,100
7777,DEF,300
7777,WCD,300
I need to covert this to below format
Output
Party_ID|ABC|AKH|DEF|LMN|WCD|XYZ... (5 Replies)
Gents,
Can you please help me to create a pivot table from a csv file. ( I have zip the csv file)
Using the file attached, columns 1,28 and 21 i would like to get something like this output
JD Val 1 2 3 4 5 6 7 8 9 10 11 12 Total... (4 Replies)
Hi
My Input is like below
DELETE|MPI|AUD_UPD_AGENT|MPISYS
INSERT|MPI|AUD_UPD_AGENT|MPISYS
SELECT|MPI|AUD_UPD_AGENT|MPISYS
UPDATE|MPI|AUD_UPD_AGENT|MPISYS
DELETE|MPI|BDYMOD|MPISYS
INSERT|MPI|BDYMOD|MPISYS
SELECT|MPI|BDYMOD|MPISYS
UPDATE|MPI|BDYMOD|MPISYS
DELETE|MPI|BDYMOD_DESC|MPISYS... (4 Replies)
Discussion started by: dineshaila
4 Replies
LEARN ABOUT DEBIAN
ptbl
PTBL(1) General Commands Manual PTBL(1)NAME
ptbl - print a type table
SYNOPSIS
ptbl [-a] <tbl-file>
DESCRIPTION
ptbl prints the give type table to stdout. It will print it in one of two formats: internal style and ASN.1 stlye. The internal style
shows the contents of the type table data structure in ASN.1 value notation. You will need to look at the tbl.asn1 file to understand the
internal form. The ASN.1 form attempts to re-create the ASN.1 that generated the given type table.
OPTIONS -a Print the table in ASN.1 style (recommended)
FILES
snacc/tbl-tools/ptbl/ Source code for the ptbl program snacc/asn1specs/tbl.asn1 ASN.1 definition for the type table data structure
BUGS
ptbl does not attempt to print the IMPORTs information even though it is possible with a bit of work.
COPYING
Copyright (c) 1993 Mike Sample and the University of British Columbia
Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the
entire resulting derived work is distributed under the terms of a permission notice identical to this one.
AUTHOR
Mike Sample <msample@cs.ubc.ca>, University of British Columbia
ACKNOWLEDGEMENTS
This work was made possible by grants from the Canadian Institute for Telecommunications Research (CITR) and Natural Sciences and Engineer-
ing Research Council of Canada (NSERC).
11 July 1993 PTBL(1)