Question: 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

 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

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- ties. 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. . An item file consists of exactly three lines: simple_name (string with no whitespace) item_name (string) current quantity (integer) maxquantity (integer) body (string) 4. Example file named 3923.item b vater Bottled Water 35 99 The finest spring vater you can purchase! Template Format Templates will 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- ties. 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. . An item file consists of exactly three lines: simple_name (string with no whitespace) item_name (string) current quantity (integer) maxquantity (integer) body (string) 4. Example file named 3923.item b vater Bottled Water 35 99 The finest spring vater you can purchase! Template Format Templates will 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!