PDF Version Available

This document is also available in PDF format: awklab.pdf

The PDF version includes bookmarks for easy navigation and is optimized for printing.

Accessibility Notice

This document is also available in HTML format at:

https://aholdengouveia.name/LinuxAdmin/labexcercises/awklab.html

The HTML version provides enhanced accessibility features including keyboard navigation, screen reader support, responsive design, dark mode support, and high contrast options.

Objectives:

Complete the following problems

References, a video and some notes are available at my website

https://www.aholdengouveia.name/LinuxAdmin/Awk.html

Please include the command, a screenshot showing it works as intended, cite all sources you used, and give a short explanation of how the command works and why.

  1. Print all the First Names.
  2. Print phone numbers for Tom and Frodo after their names
  3. Print Peregrin's full name and phone number area code only.
  4. Print all phone numbers (full number) in the 123 area code along with the names
  5. Print all Last names beginning with either a T or D (careful of middle names!)
  6. Print all first names containing four or less characters.
  7. Print the first names and area codes of all those in the 916 area code.
  8. Print Sacharissa's campaign contributions following her name. Each value should be printed with a leading dollar sign; e.g., \$250 \$100 \$175.
  9. Print last names followed by a comma and the phone number. Be careful of the last names's format.
  10. Print the first and last names of those who contributed more than \$110 in the last month. Make sure to include their last month contribution amount after the name
  11. Print the last names, phone numbers, and first month contribution of those who contributed less than \$150 in the first month.
  12. Print the first names and contribution of those who contributed between \$10 and \$200 in the first month.
  13. Print the first name, last names and total contributions of those who contributed less than \$700 over the three-month period.
  14. Print the first names and first letter of the last name, and average contribution of those who had an average contribution of more then \$300
  15. Print the last name and area code of those not in the 916 area code.
  16. Print each record preceded by the number of the record.
  17. Print the name and total contribution of each person.
  18. Add \$10 to Tiffany Aching's first contribution and print her full name and first contribution.
  19. Change Samwise Gamgee's name to Sean Astin
  20. Write an awk script to do the following (MUST be an awk script not just a bash script or commands on the commandline) enumerate
  21. Prints first name of the all the Tooks followed by their total campaign contributions .
  22. Print the full names and contributions of anyone who contributed between \$10 and \$200 in the last contribution
  23. Prints the full names and average contribution of those who contributed less than \$300 on average

Deliverables

A text document with the awk statements used to get each result. Clearly labeled so I can see which answer goes to which question.

Please include the command, a screenshot that includes the command and a few results showing it works as intended, cite all sources you used, and give a short explanation of how the command works and why. Make sure everything is in your own words. Think of the explanation as you trying to walk someone through how to use awk when they haven't heard of it before.