awkScripts

Assignment Details

coinSummary.awk

A file  named “coins.txt” that describes a coin collection is provided. Each line in the file contains the following information
        “metal weight_in_ounces date_minted country_of_origin description”
Write an awk script (coinSummary.awk) that generates the following summary data for coin collection. Assume the price of gold is $1771.00 per ounce and the price of silver is $34.25 per ounce. The format of the program output should be:

        Gold pieces:                        9
        Weight of gold pieces:           6.10
        Value of gold pieces:       9729.50

        Silver pieces:                     4
        Weight of silver pieces:      12.50
        Value of silver pieces:      371.87

        Total number of pieces:        13
        Value of collection:       10101.37
  

director.awk

Create an awk script called director.awk, which generates a report with the name, department name and salary of all the directors in the file empn.lst.
The script can be executed as:
      awk –f director.awk empn.lst

getRecordsByName.awk

Write an awk script to facilitate access to the student records.

The script will accept a student name as its only argument and will print on the standard output all the matching records from classList. The command argument may be a student’s given name, or a family name. The displayed student record(s) should be space separated and preceded by informative column titles.
If there are no matching records, the user should be informed.

marketing.awk

Create an awk script called marketing.awk which displays the name, the position and the salaries of all the employees in the marketing department.
The script can be executed as:
     ./marketing.awk empn.lst