Hello all,
I'm totally new to UNIX/Linux but I'm taking a course in it at my local JC.
My question: I have been tasked with writing a gawk script that will create a nicely formatted report. That part I've done ok on...however, the very last thing that must be done is a calculation of a particular field of data. Here is my script:
BEGIN { printf("%s%12s%10s%10s\n", "Date", "Low", "High", "Rain")
printf("=====================================\n") }
{ printf("8s%8s%10s%10s\n", $2, $4, $7, $11) }
END { printf"=====================================\n")
printf("Total Rain = %d\n", NR) }
I need the last line of code to calculate field $11 which should come out to 2.5 inches of rain based on my data file. I know right now that the last line of code is only calculating the number of records.
Any ideas?
Thanks in advance!
Trellot
