Merging two data files and getting output.

From: Alistair McKeown (Alistair.Mckeown@jacobsrimell.com)
Date: Thu Apr 14 2005 - 06:52:22 EDT


Hi there gurus,

                This problem has been killing me for weeks.

I have one file called 'final_results' which contains a billing number
firstname and surname in the format:

5273163,J,KasteeleBoerlage
5175633,M,Heuvelmans
6071192,C,LuytEnKoolen

I also have a file called ldapResults.txt which contains in an ldif format :

dn: cn=710000190,ou=users,ou=amsterdam,ou=domains,ou=nl,ou=domains,o=chello
apsPassword: j.kasteele boerlage
userFriendlyUserID: j.kasteele boerlage
BillingNumber: 5273163

dn: cn=710000690,ou=users,ou=amsterdam,ou=domains,ou=nl,ou=domains,o=chello
apsPassword: m heuvelmans
userFriendlyUserID: m heuvelmans
BillingNumber: 5175633

What I was wanting to do is to use the first file and say where it matches
the billing number in the 2nd file, replace the apsPassword and
UserFriendlyUserID with the firstname and surname in the first file.

So I would have an 1st output like this

dn: cn=710000190,ou=users,ou=amsterdam,ou=domains,ou=nl,ou=domains,o=chello
apsPassword: j.kasteeleboerlage
userFriendlyUserID: j.kasteeleboerlage
BillingNumber: 5273163

Where the apsPassword and UserFriendlyUserID has been picked up from the
first file and changed so it doesn't have a space in it. This problem has
been racking my brains for ages. Could it be done in a perl script, or some
super command(s)?

Any help would be a life saver!

Kind Regards,

Alistair.
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:30:32 EDT