Question: Activity In this lab, youll use 2 folder: An Inbound from where youll be writing your script, and an Auto folder where all files that

Activity

In this lab, youll use 2 folder: An Inbound from where youll be writing your script, and an Auto folder where all files that are ready for automatic processing will be placed.

The input file is called sample_enrollment.csv

Name the pre-processed file (output file) enrollment_.csv

Consider the file sample_enrollment.csv. It is an Enrollment File that must be pre-processed before it can be run automatically. You are to write an AWK script, enrollment.awk, to do the pre-processing according to the requirements below:

First, change "EffectiveDate" header to "Effective Date".

Then for each of the requirements below, write a function to complete it:

The Effective date for Drop status must be changed to the last day of the month of the associated Effective Date. For example, in the sample file, the last record has a Drop status. Its effective date is 03/25/2018. This must be changed to 03/31/2018.

Format the area code and Home phone number fields to 3 digits and 7 digits respectively. For example, in the sample file, the first record has no value for the area code and "+1 206 8497834" for the home phone. This should be changed to Area code = 206, and Home phone = 8497834.

Remove all records with Change status so that only the Add and Drop statuses will be processed.

Finally, save the changed contents in a new filename (as indicated above) and place a copy into the Auto folder.

EffectiveDate Status EmployeeID ClientID MemberFirstName MemberMiddleName MemberLastName MemberSSN DOB_Month DOB_Day DOB_Year Address1 Address2 City State ZipCode AreaCode HomePhone Email Deduction Method Customer_Defined Relationship Primary FamilyID UniqueID
5/12/2017 Add 534336699 1511 Jon B Doe 123456789 3 17 1980 67 NW 67th Street Tempe AZ 85281 +1 206 8497834 ift383@asu.edu Employer payroll deduction P Y 9170885 109170885
11/25/2017 Drop 534336699 1511 Alpha Gaspart 987654321 4 21 1961 7659 E 12th Ave Seattle WA 98117 + 206. 369.2073 ift383@asu.edu Employer payroll deduction S N 9170885 200319606
12/11/2017 Change 534336699 1511 Mat J Simmon 987123456 10 7 1995 1234 W 17th Street Seattle WA 98106 + 206.369.2073 ift383@asu.edu Employer payroll deduction C N 9170885 200319607
3/25/2018 Drop 534336699 1511 Lance Peck 123087654 12 2 2010 12 S Pokoma, #15 Bldg 1002 Boulder CO 76540 9172701515 ift383@asu.edu Employer payroll deduction C N 9170885 200319608

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!