Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help awk with print

Status
Not open for further replies.

SP68

IS-IT--Management
May 22, 2005
18
US
All,

I have a text file looks similar below:

DN: cn=user1,ou=admin,o=abc
changetype: add
l: loc1
HomeDirectory: FS1_vol0,ou=servers,o=abc

DN: cn=user2,ou=is,o=abc
l: loc2
messageserver: fs2
homedirectory: FS2_vol0,ou=servers,o=abc

.
.
.

I wanted to use awk to do this:

DN: same as below
changetype: add
replace: l (print this line new line)
l: loc1
- (print this dash)
replace: homedirectory (print this line)
homedirectory: FS1_vol0,ou=servers,o=abc

DN: cn=user2,ou=is,o=abc
changetype: add
replace: l ( print this line)
l: loc2
- (print this dash)
replace: messageserver (print this line)
messageserver: fs2
- (print this dash)
replace: homedirectory ( print this line)
homedirectory: FS2_vol0,ou=servers,o=abc


Thanks,

SP






 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top