Sponsored Content
Homework and Emergencies Homework & Coursework Questions awk script that implements a report writer Post 302417196 by Jeffthrow5 on Wednesday 28th of April 2010 10:58:13 PM
Old 04-28-2010
awk script that implements a report writer

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!

1. The problem statement, all variables and given/known data:
The script should compute the sale amounts per associate for the year 2009 and print them in a sorted list ranked according to the sales amount.
Here is an example of the script invocation using the data provided in the example file:
$ awk -f report inputfile
Lazy Acres, Inc.
2009 Sales Associates Ranking
Name Position Sales Amount
==========================================
Buck, Fast Stock Boy 2630.78
Rush, George Salesman 1049.79
Worker, Susan Manager 360.00
Doe, John Clerk 134.01
Lindon, Rosemary Producer 31.00
Miller, Dennis Commedian 9.90


2. Relevant commands, code, scripts, algorithms:



3. The attempts at a solution (include all code and scripts):
This is what I have so far, I don't know what to do next:
Code:
BEGIN{print "Lazy Acres, Inc"
      print "2009 Sales associates Ranking"
      print "Name        Position        Sales amount"
      print "========================================"
      FS=":"
      }

NF==3 {cost[$1]=$3}


NF==4 && $3 ~ /2009/ {tot = $2 * cost[$1]
                      emplId[$4] +=tot}

NF==5 {  emplId2[$1]
         first[$2]
         last[$3]
         position[$5]

      }

I think i need to get emplId to represent the person and position but I don't know how to do that, any help leading me in the right direction would be great, I've attatched the inpute file to view



4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
niu, dekalb, Il, ege, 241

Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Share CD-Writer

Hi, guys ! I have a server that runs FreeBSD 5.3 and on that server a have a CD-Writer used for backup. The question is, does anybody know how can I share this CD-Writer ? I want to be able to write CDs from another computer, without transfering all the data to the server and after that use all... (2 Replies)
Discussion started by: Sergiu-IT
2 Replies

2. UNIX for Advanced & Expert Users

Probleme With DVD Writer

I Use mkcd for save same directories into DVD, But the commande not complete succefuly mkcd -r directorie_i_whish_save -d /dev/cd1 please it is very urgent thank you :confused: :confused: (1 Reply)
Discussion started by: mktahar
1 Replies

3. AIX

Probleme with DVD Writer

I can write into DVD? I have USE "MKCD" command mkcd -r directorie -d /dev/cd1 please help me it s urgent (2 Replies)
Discussion started by: mktahar
2 Replies

4. Shell Programming and Scripting

Awk Script for generating a report

Hi all, I have a log file of the below format. 20081016:000042 asdflasjdf asljfljs asdflasjf safjl 20081016:000229 /lask/ajlsdf/askdfjsa 20081016:000229 /lashflas /askdfaslj hsfhsahf 20081016:000304 lasflasj ashfashd 20081016:000304 lajfasdf ashfashdfhs I need to generate a... (3 Replies)
Discussion started by: manoj.naidu
3 Replies

5. Homework & Coursework Questions

How Unix implements virtual memory?

Use and complete the template provided. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: The key to using memory most efficiently is virtual memory management. Consider both Windows and UNIX operating systems. Compare and contrast how each... (0 Replies)
Discussion started by: kjcruz
0 Replies

6. HP-UX

How Unix implements virtual memory?

Hello! just wanna ask if how UNIX implements virtual memory, and how it handles page faults, working sets, page sizes and how it reconciles thrashing issues? if you know some sources where I can have some idea, just post it here. thx (1 Reply)
Discussion started by: kjcruz
1 Replies

7. UNIX for Advanced & Expert Users

How to implements Queueing Using Shell scripts

I want to implement a control mechanism using Shell scripts .The intention is to have controlled number of jobs running in parallel External process will kickstart 40 jobs in parallel .All the 40 jobs will call the same generic script with different parameter values .But at a time only 2 should... (1 Reply)
Discussion started by: police
1 Replies

8. Homework & Coursework Questions

Awk Script that implements a report writer

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write an awk script that implements a report writer. Here is what I need to do: The report computes summary data... (9 Replies)
Discussion started by: bravens52
9 Replies
lmfsetup(8)						      System Manager's Manual						       lmfsetup(8)

NAME
lmfsetup - License Management Facility (LMF) registration script SYNOPSIS
/usr/sbin/lmfsetup [template] DESCRIPTION
You use the lmfsetup script to register data supplied by a Product Authorization Key (PAK). The lmfsetup script prompts you for the data associated with each field on a PAK. Once you enter all the data, LMF makes sure you have supplied entries for all mandatory fields and that the value in the Checksum field validates the license data. If all data is correct, LMF registers the PAK in the License Database. If any data is incorrect, LMF displays the appropriate error message and gives you an opportunity to reenter the data. The template argument allows you to register license data from templates in /usr/var/adm/lmf. The templates stored in this directory are created by some software products during their installation process. When you use a template, the script prompts you to supply data for any empty fields in the template. If the lmfsetup script cannot find the specified template in /usr/var/adm/lmf, it searches your current work- ing directory. Use the lmfsetup script when you want to register a PAK without using an editor. Normally, you should use the lmf register command. The lmf register command displays a template, which includes the fields on the PAK, and invokes an editor so that you can add the license data to the appropriate fields. The lmf register command allows you to correct errors without having to reenter all the data. SEE ALSO
Command: lmf(8) Software License Management lmfsetup(8)
All times are GMT -4. The time now is 09:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy