Hi,
I am using Sun Solaris - SunOS. I have two fixed width files shown below. I am trying to find the changes in the records in the Newfile.txt for the records where the key column matches. The first column is a key column (example: A123).
If there are any new or deletion of records in the Newfile, I do NOT want that in the output.
All I am try to achieve is the output of the changed records where the key column matches.
File1:OldFile.txt
A123 Sim Firstname1 Lastname1 123 JESSE DR. Atlanta GA32839 Sampleemail@YAHOO.COM
B234 TWD Firstname2 Lastname2 123 FORTHILL1 DR. Atlanta GA32839 Sampleemail2@YAHOO.COM
C567 TWD Firstname3 Lastname3 123 FORTHILL2 DR. Atlanta GA32839 Sampleemail3@YAHOO.COM
D89012 TWD Firstname3 Lastname3 123 FORTHILL2 DR. Atlanta GA32839 Sampleemail3@YAHOO.COM
File2:NewFile.txt
A123 Sim UpdatedNewFirstName1 UpdatedNewLastname1 123 JESSE DR. Atlanta GA32839 sampleemail@YAHOO.COM
B234 TWD Firstname2 Lastname2 123 FORTHILL1 DR. Atlanta GA32839 Sampleemail2@YAHOO.COM
C5676 TWD Firstname3 Lastname3 123 FORTHILL2 DR. Atlanta GA32839 Sampleemail3@YAHOO.COM
Z12345 TWD Firstname3 Lastname4 123 FORTHILL2 DR. Atlanta GA32839 Sampleemail3@YAHOO.COM
So in above example: Output would be as shown below. The UpdatedNewFirstName1 and UpdatedNewLastname1 for key A123
is changed.
A123 Sim UpdatedNewFirstName1 UpdatedNewLastname1 123 JESSE DR. Atlanta GA32839 sampleemail@YAHOO.COM
and ignore the two records below:
D89012 TWD Firstname3 Lastname3 123 FORTHILL2 DR. Atlanta GA32839 Sampleemail3@YAHOO.COM
-- This record dropped in new file. I do not want this in my output.
Z12345 TWD Firstname3 Lastname4 123 FORTHILL2 DR. Atlanta GA32839 Sampleemail3@YAHOO.COM
-- This record added in new file. I do not want this either.
PS: Please ignore the format of the files as I created a sample file above, which might be slightly off.
All I need a CHANGED records where the first field keys matches.
Thanks