Hi,
I'd like to create a perl script that takes two input files, one being a master list of users/attributes, the other being a newly uploaded list.
I'd like two output files, one being a file with new users (not in the master list) as well as updated users (changed attributes). The 2nd output file should be an updated master list file.
I believe this would be best done with a hash table. I originally attempted with a nested loop but the performance was terrible as expected.
Here is an example of the two input files:
MASTER FILE
username,lastname,location,password --just a header for reference
adam,adams,alabama,alpha
brian,benson,wyoming,bravo
chad,carson,california,charlie
daniel,davis,delaware,delta
UPLOAD FILE
adam,adams,alabama,alpha
daniel,davis,texas,delta
frank,fortune,florida,foxtrot
OUTPUT 1
daniel,davis,texas,delta,UPDATE
frank,fortune,florida,foxtrot,NEW
OUTPUT 2 NEW MASTER FILE
adam,adams,alabama,alpha
brian,benson,wyoming,bravo
chad,carson,california,charlie
daniel,davis,texas,delta
frank,fortune,florida,foxtrot
Some fields will be case sensitive (password) while others will not be. Some can also contain numbers.
If anyone can help me with a start I would be most appreciative.
-Adam