Question: Write a bash script named Merge to do a ''mail merge , .., fill in values into a form letter. You may invoke awk and/or

 Write a bash script named Merge to do a ''mail merge

Write a bash script named Merge to do a ''mail merge , .., fill in values into a form letter. You may invoke awk and/or sed in your bash script, as needed. For example, you might have your bash script dynamically construct a sed program and execute it The first argument to the script should be a text file that is the template for the form letter, called the template ile. Inside this file, text of the form %n for integer n indicates that this will be replaced by field number n during the merge. The second argument to the script should be a text file with fields, called the database file. Fields are separated by commas and records are separated by newline characters. The script should produce text files in the current directory, named 1.txt, 2.txt, , m.txt where m is the number of lines in the database file. File i.txt should be the template file, with fields plugged in according to record i (line number i) in the database file. If record has fewer fields than what is required by the template, then the missing values should remain un-replaced Write a bash script named Merge to do a ''mail merge , .., fill in values into a form letter. You may invoke awk and/or sed in your bash script, as needed. For example, you might have your bash script dynamically construct a sed program and execute it The first argument to the script should be a text file that is the template for the form letter, called the template ile. Inside this file, text of the form %n for integer n indicates that this will be replaced by field number n during the merge. The second argument to the script should be a text file with fields, called the database file. Fields are separated by commas and records are separated by newline characters. The script should produce text files in the current directory, named 1.txt, 2.txt, , m.txt where m is the number of lines in the database file. File i.txt should be the template file, with fields plugged in according to record i (line number i) in the database file. If record has fewer fields than what is required by the template, then the missing values should remain un-replaced

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!