Write a script to calculate the average score and assign a letter grade for each student, also compute the average score for every test (the source data is in the file “grades”). Output all students' name, scores, and grades in descending order of the average score. Note: please save the output to the file “finalgrades”.
Contents of source data file (grades):
Peter:90:80:70
Alice:79:89:69
David:99:79:89
The final letter grade will be determined based on the following criteria:
A: 90 and above; B: 80 thru 89; C: 70 thru 79; D: 60 thru 69; E; 50 thru 59; F: <50.
Output (finalgrades)
How do I alias the FILE name into awk?
gawk -f awk_script FILE
or
FILE | gawk awk_script
for FILE in `find ./* -prune -type f -newer ./TIMEFILE`
do
# Need to have the actual FILE name ran thru an awk script
done (1 Reply)
I am new to UNIX and I need a sample awk or sed program to solve the following problem.
I have a file with the following format. The file is comma delimited. Each record has header information followed by looping detailed information. In addition the detailed information will vary based on a... (2 Replies)
Hi
can anyone pls help me out in knowing how a array of elements which are fetched from database is passed to the awk program.
Something like this
#!/bin/sh
AMT=`sqlplus -s usrname/pswd <<EOD
set pagesize 0 feedback off verify off heading off echo on
select amount from... (11 Replies)
Hey everyone! Can someone help me, i need to make a program using awk, that displays the current time (hh/mm/ss), i would really apreciate it! Thanks!
Alex. (4 Replies)
Hi,
I am working on a script where i am fetching a word from a parameter file and using it as output file name .
here is the part of parameter file contents : it basically contains SQL statements.
Select 'SSFNRTP' as TABLE_NAME,UCSTDT,CVOFIDKEY from (Select 'cofvof_interface' as... (2 Replies)
Hi,
I have a file as given below $cat int_check
239|adf123@yahoo.com|999e
23e|get@rediff.com|987
233|get@rediff.com|987
I am running the command as given to find whether field 1 and 3 have proper integer values or not.
awk -F'|' 'int($1)!=$1 || int($3)!=$3' int_check... (7 Replies)
Hi, I am new to unix shell script and I have some trouble on the awk sub
I would like to pick the Date "July 10 2012" into $corr_date by using sub() function, but it is not successful.
The inputted text file:
pic.*.txt
July 10 2012 20:30:50 , 1234567.jpg
July 10 2012 20:30:52 , 5648978.jpg... (1 Reply)
Hello Everyone,
May I ask for your help regarding one of the UNIX command “awk”. So I executed a script and the output looks like this (see below):
output.txt
CONTRACTNAME ... (3 Replies)