![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| AWK - printing certain fields when field order changes in data file | eric4 | Shell Programming and Scripting | 3 | 04-15-2008 06:48 PM |
| How to split a field into two fields? | vbrown | Shell Programming and Scripting | 4 | 02-21-2008 06:50 AM |
| I need help counting the fields and field separators using Nawk | scrappycc | Shell Programming and Scripting | 3 | 02-06-2008 11:47 PM |
| how to include field separator if there are blank fields? | ReV | Shell Programming and Scripting | 19 | 07-13-2005 04:50 AM |
| AWK create loop for fields | tonet | Shell Programming and Scripting | 1 | 07-07-2005 09:50 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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 |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|