Home
Man
Search
Today's Posts
Register

BSD, Linux, and UNIX shell scripting ó Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

awk question

Tags
shell scripts

Login to Reply

 
Thread Tools Search this Thread
# 1  
Old 02-25-2016
awk question

I have a data set that has 9 columns (Name, Type, Score).
here's a sample name=name, Type = Q(for quiz) - E(for exams) - H(for Homework) - F(for final), Score = 90.
I can easily add up all my scores then divide them for average or mean (total/n). How do I assign the value to corresponding letter in an Array

Ex.

Code:
Name   Type   Score   Type   Score   Type   Score   Type   Score
Jones     Q        90       H        100     E        74        F        75
Bob          q         80      H        70       e        88        f        77


if I want to ad all the digits after Q (like 90 and 80) to get the average, how would I throw them in an array to get the mean?

Last edited by Don Cragun; 02-25-2016 at 08:58 PM.. Reason: Add CODE tags.
# 2  
Old 02-25-2016
Is this a homework assignment? Homework and coursework questions can only be posted in the Homework & Coursework forum following the requirements specified in the special homework rules.

If you did post homework in the main forums, please review the guidelines for posting homework and repost in the correct sub-forum and include a completely filled out homework template. Otherwise, please explain what real problem you are trying to solve here.

Show us what code you have tried to solve your problem (in CODE tags) and show us the output you are trying to produce (also in CODE tags) from the sample input you have provided.
Login to Reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Question about awk Homa Shell Programming and Scripting 2 06-14-2013 12:45 PM
another awk question greycells Shell Programming and Scripting 5 03-15-2011 05:31 PM
C++ little question faizlo Programming 11 03-10-2011 04:25 PM
sed question OldNo7 Shell Programming and Scripting 2 09-10-2008 07:51 AM
sed or awk question thegant UNIX for Dummies Questions & Answers 2 08-15-2008 03:43 PM
a question... Jariya Shell Programming and Scripting 1 06-03-2006 02:19 PM
API question q30 AIX 0 08-02-2004 05:03 AM
cd-r vs. cd-rw question jalburger UNIX for Dummies Questions & Answers 4 07-29-2004 12:05 PM
sed question hedrict Shell Programming and Scripting 1 07-19-2004 05:46 AM


All times are GMT -4. The time now is 09:34 PM.

Unix & Linux Forums Content Copyright 1993-2018. All Rights Reserved.
UNIX.COM Login
Username:
Password:  
Show Password