Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this assignment, you will use awk, sed, and bash to create a simple templating engine. Your program should take as input a generic template

image text in transcribedimage text in transcribedimage text in transcribed

For this assignment, you will use awk, sed, and bash to create a simple templating engine. Your program should take as input a generic template with placeholders for generic data, a set of input files containing data which should be applied to the template, and a date. Instantiated templates using the input data will be output to a subdirectory This assignment requires only sed, awk, and bash. Do not use Python or any other languages/util ities Hint: Since you will need to produce many files from many inputs, it may be useful to use awk to generate sed and/or bash scripts Data Format Your program should only process input data for items with an inventory of less than 10%. For example, an item with a maximum quantity of 100 and a current quantity of 9 should generate an output file, whereas an item with a maximum quantity of 50 and a current quantity of 39 should not 1. Data files will be stored inside a directory called data within the same directory as your script 2. Each file will be named based on the item number, an integer with exactly four digits, followed by the extension .item 3. An item file consists of exactly three lines - simple_name (string with no whitespace) item_name (string) - current_quantity (integer) max_quantity (integer) body (string) 4. Example file named 3923.item b_water Bottled Water 35 99 The finest spring water you can purchase! Template Format Templates wil include variable names to be filled in with data using double angle brackets. For any data file of the format described above, each of the variables should be substituted with the data's actual value. Your program should work for arbitrary templates using the same variables listed below corresponding to the item values described above - > For this assignment, you will use awk, sed, and bash to create a simple templating engine. Your program should take as input a generic template with placeholders for generic data, a set of input files containing data which should be applied to the template, and a date. Instantiated templates using the input data will be output to a subdirectory This assignment requires only sed, awk, and bash. Do not use Python or any other languages/util ities Hint: Since you will need to produce many files from many inputs, it may be useful to use awk to generate sed and/or bash scripts Data Format Your program should only process input data for items with an inventory of less than 10%. For example, an item with a maximum quantity of 100 and a current quantity of 9 should generate an output file, whereas an item with a maximum quantity of 50 and a current quantity of 39 should not 1. Data files will be stored inside a directory called data within the same directory as your script 2. Each file will be named based on the item number, an integer with exactly four digits, followed by the extension .item 3. An item file consists of exactly three lines - simple_name (string with no whitespace) item_name (string) - current_quantity (integer) max_quantity (integer) body (string) 4. Example file named 3923.item b_water Bottled Water 35 99 The finest spring water you can purchase! Template Format Templates wil include variable names to be filled in with data using double angle brackets. For any data file of the format described above, each of the variables should be substituted with the data's actual value. Your program should work for arbitrary templates using the same variables listed below corresponding to the item values described above - >

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

Database In Depth Relational Theory For Practitioners

Authors: C.J. Date

1st Edition

0596100124, 978-0596100124

More Books

Students also viewed these Databases questions