|
Create a calculated field from existing fields
I need to add an average field to a file. I can create it in an on-screen report and it does what I need using the awk command but I can't get it to create a new file with the additional field. Here's what I'm working with:
file layout: id:lastname:firstname:grade1:grade2:grade3:grade4
I need the avg field added after grade 4.
The calculation I used in the awk statement to print the extra field was:
($4*.5+$5*.2+$6*.1+$7*.2)
I can't get this into a file though. Any ideas would be greatly appreciated. Thanks
|