![]() |
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 |
| Beginner needs help with script | martyb555 | Shell Programming and Scripting | 2 | 02-16-2008 01:24 PM |
| Beginner Questions | Darin | UNIX for Dummies Questions & Answers | 3 | 07-16-2007 11:47 AM |
| Beginner C | frustrated1 | High Level Programming | 2 | 05-21-2007 02:14 PM |
| Please help. I am a beginner. | Lykathea Aflame | Shell Programming and Scripting | 1 | 04-26-2006 01:46 AM |
| UNIX beginner - I need help please | JennyW | UNIX for Dummies Questions & Answers | 2 | 05-09-2001 08:17 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
AWK help please - beginner
Hi, I'm in dire need of some help for AWK. I'm a college student and my statistics professor decided he'd teach AWK in the last two days of our class, even when it's not programming class and we don't even have computers in class to experiment. Anyway, I tried looking at AWK tutorials, but it doesn't necessarily teach me in the sequence our professor taught it. This is the code our professor wrote on the board for printing lines. I can't figure the thing out. If anyone can interpret it or correct me (if I miscopied the code), thank you.
Abe M 70 Bea F 65 Cathy F 67 Dave M 69 Code:
{if ($2 == "M"){
s=s+$3
n=n+1
}END{
print s, n, s/n, "avg height"
}
Here's another one. Abe M 70 Bea F 65 Cathy F 67 Dave M 69 Code:
{
if ($N / [fF] /) {
fsum = fsum + 3
fnum = fsum + 1
}
if ($2N/[mM]){
msum = msum + $3
mnum = mnum + 1
}
}
THX I've studied HTML, Javascript and CSS in the past, and I like to know what each line or code does. I'm very OCD with programming, but it just frustrates me that the professor is simply teaching it this way WITHOUT (i repeat) a computer. This has got to be, by far, the most knuckleheaded professor I've probably taken in this college. Thx for the help. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|