rycher has asked for the wisdom of the Perl Monks concerning the following question:
My question is: How would I open both files, read in all of the contents into arrays, key in on the username as a match-point and update the LDIF file with data from the employee database?
This is what the employee data contains:
Here is data from the LDIF file:dn: uid=simpsonh givenName: Homer sn: Simpson department: Nuclear Control Center buildingName: Radioactive Hall telephoneNumber: 218 555-6793 faxNumber: 218 555-6798 title: Nuclear Control Operator manager: uid=burnsm
dn: uid=simpsonh,ou=People,dc=sfnp,dc=com userPassword:: e1NTSEF9dkI0NnhHT1A5MTBdgfsdghfSFWHDFW239jhsdv= cn: Homer Simpson givenName: Homer sn: Simpson mail: simpsonh@sfnp.com loginShell: /bin/ksh objectClass: top objectClass: person objectClass: organizationalPerson objectClass: inetOrgPerson objectClass: posixAccount objectClass: operator uidNumber: 111 gidNumber: 101 uid: simpsonh timeOut: 1128100385 auditDate: Mon Nov 7 04:50:00 2005 memberOf: cn=Operators,ou=Groups,dc=sfnp,dc=com ssn: 1111 firstTime: 0 homeDirectory: /export/home/simpsonh
...and this is what it should look like when all said and done:
dn: uid=simpsonh,ou=People,dc=sfnp,dc=com userPassword:: e1NTSEF9dkI0NnhHT1A5MTBdgfsdghfSFWHDFW239jhsdv= cn: Homer Simpson givenName: Homer sn: Simpson mail: simpsonh@sfnp.com loginShell: /bin/ksh objectClass: top objectClass: person objectClass: organizationalPerson objectClass: inetOrgPerson objectClass: posixAccount objectClass: operator uidNumber: 111 gidNumber: 101 uid: simpsonh timeOut: 1128100385 auditDate: Mon Nov 7 04:50:00 2005 memberOf: cn=Operators,ou=Groups,dc=sfnp,dc=com ssn: 1111 firstTime: 0 homeDirectory: /export/home/simpsonh department: Nuclear Control Center buildingName: Radioactive Hall telephoneNumber: 218 555-6793 faxNumber: 218 555-6798 title: Nuclear Control Operator manager: uid=burnsm
Thank you in advance for any help and guidance.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Compare Two Files, Merge Updates from One File to the Other
by graff (Chancellor) on May 04, 2009 at 06:04 UTC | |
by rycher (Acolyte) on May 04, 2009 at 12:30 UTC | |
Re: Compare Two Files, Merge Updates from One File to the Other
by ELISHEVA (Prior) on May 04, 2009 at 08:46 UTC | |
Re: Compare Two Files, Merge Updates from One File to the Other
by strat (Canon) on May 04, 2009 at 10:38 UTC | |
by rycher (Acolyte) on May 04, 2009 at 12:50 UTC |