I have the following tab delimited master.txt file which has about 1000 records and looks like this:
NTADPH0853M00 Premier WST None "Lee, Tom" 4607 "Lee, Tom"
NTADPH0892M00 Standard; Prime Shift Monitoring WST None "JOHNSON, DON"
ntadph0919m00 Standard; Prime Shift Monitoring wst None "Lee, Tom"
ntadph0961m00 Standard; Prime Shift Monitoring WST None "Wayne, John"
NTADPH0964L01 Premier WST None "Smith, Adam" 3786 "Smith, Adam"
Then I have a tab delimited update.txt file which has about 1000 records also and looks like this:
NTAPTH0236M01 19687 307 1 1
NTADPH0853M00 31612 508 9 24
NTAPTH0271M00 21735 307 4 4
ntadph0919m00 19072 301 2 3
NTADPH0964L01 18000 307 4 4
I want to create a Perl script that will check for matches with the update.txt file against the master.txt file. If a match is found the master.txt file would be appended with the last four fields from the update.txt file.
There are 3 records from the update.txt file that are found in the master.txt file in the above example.
The result would look like this:
NTADPH0853M00 Premier WST None "Lee, Tom" 4607 "Lee, Tom" 31612 508 9 24
ntadph0919m00 Standard; Prime Shift Monitoring wst None "Lee, Tom" 19072 301 2 3
NTADPH0964L01 Premier WST None "Smith, Adam" 3786 "Smith, Adam" 18000 307 4 4
I also want to produce an error listing of all the records in the update.txt file that don't match up with the master.txt file.
thanks
NTADPH0853M00 Premier WST None "Lee, Tom" 4607 "Lee, Tom"
NTADPH0892M00 Standard; Prime Shift Monitoring WST None "JOHNSON, DON"
ntadph0919m00 Standard; Prime Shift Monitoring wst None "Lee, Tom"
ntadph0961m00 Standard; Prime Shift Monitoring WST None "Wayne, John"
NTADPH0964L01 Premier WST None "Smith, Adam" 3786 "Smith, Adam"
Then I have a tab delimited update.txt file which has about 1000 records also and looks like this:
NTAPTH0236M01 19687 307 1 1
NTADPH0853M00 31612 508 9 24
NTAPTH0271M00 21735 307 4 4
ntadph0919m00 19072 301 2 3
NTADPH0964L01 18000 307 4 4
I want to create a Perl script that will check for matches with the update.txt file against the master.txt file. If a match is found the master.txt file would be appended with the last four fields from the update.txt file.
There are 3 records from the update.txt file that are found in the master.txt file in the above example.
The result would look like this:
NTADPH0853M00 Premier WST None "Lee, Tom" 4607 "Lee, Tom" 31612 508 9 24
ntadph0919m00 Standard; Prime Shift Monitoring wst None "Lee, Tom" 19072 301 2 3
NTADPH0964L01 Premier WST None "Smith, Adam" 3786 "Smith, Adam" 18000 307 4 4
I also want to produce an error listing of all the records in the update.txt file that don't match up with the master.txt file.
thanks