Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is in Unix THE AWK PROGRAMMING SYSTEM Problem 4 (6 points): Answer the following questions about AWiK _data processing a) The AWK programming language

This is in Unix

image text in transcribed

THE AWK PROGRAMMING SYSTEM Problem 4 (6 points): Answer the following questions about AWiK _data processing a) The AWK programming language focuses on b) Assume you have a file called 'processNumbers.awk' containing AWK commands. Give the shell command line to execute the AWK commands in this Give AWK commands for accomplishing each of the following c) Print the total number of lines from a file named 'total.txt' d) Print the 2nd last field (the field directly before the last field) of each line from a file named 'second.txt' e) Assume you have a file called 'items' that contains a list of items, one item per line. Also assume that on each line, the 4th field on that line contains the price of that item. Some of the items do not have a price listed, and those lines only have 2 fields. Print the total price for all the items that have a price f) Exchange the first and the last fields of every line, and then print the lines (you can print each line directly after the exchange). After printing all of the lines, print out the message Finished!". Assume the file name is 'exchange.txt. HINT: To switch the two fields around, you'll need to use a temporary variable

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Formal SQL Tuning For Oracle Databases Practical Efficiency Efficient Practice

Authors: Leonid Nossov ,Hanno Ernst ,Victor Chupis

1st Edition

3662570564, 978-3662570562

More Books

Students also viewed these Databases questions

Question

7. Explain why retirees may be valuable as part-time employees.

Answered: 1 week ago