0

Hi,

I have two files--

file1-


Quote:
dn: cn=Anandmohan Singh,ou=addressbook,dc=thbs,dc=com
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
cn: Anandmohan Singh
givenName: Anandmohan
mail: anand_ms@thbs.com
mobile: 9986010455
ou: null
physicalDeliveryOfficeName: ST-6th Floor
sn: Singh
telephoneNumber: 41827200 Extn: 7400
title: Associate Software Engineer - Trainee
uid: 1432

dn: cn=Riteshkumar Mohanty,ou=addressbook,dc=thbs,dc=com
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
cn: Riteshkumar Mohanty
givenName: Riteshkumar
mail: ritesh_m@thbs.com
mobile: 9916953109
ou: null
physicalDeliveryOfficeName: ST-6th Floor
sn: Mohanty
telephoneNumber: 41827200 Extn: 7400
title: Associate Software Engineer - Trainee
uid: 1418

file2:-


Quote:
uid:Password
0050:thbs
1418:thbs
1432:thbs

i have to compare two files and where the uid is same i have to take the password and insert it above the telephone number.

the output should be like this--

uid : 1418 common so insert the password thbs above the line telephonenumber.

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by larryperl
0

Hey There,

What have you got so far? You should be able to grep the uid/pwd line out of the second file and use awk or sed to insert the necessary line (perhaps use awk to do it all - for the millions of people who are better at using awk than I am :)

, Mike

0

I am not familiar with awk and very little knowledge of sed i have.So i need help of you guys.

Thanks..

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.