Parsing delimited file
Advance thanks for your help. I have a tab delimited file containing the ldap username and their corresponding passwords in the following format
dn:uid=user1,o=foobar.com new_password
dn:uid=user2,o=foobar.com new_password
dn:uid=user3,o=foobar.com new_password
what i want to achieve is loop through the file and create text in the below format with a space in between them. Please help me out as am not so good with scripting. Thanks once again
dn:uid=user1,o=foobar.com
changetype:modify
replace:userpassword
userpassword:new_password
dn:uid=user2,o=foobar.com
changetype:modify
replace:userpassword
userpassword:new_password
dn:uid=user3,o=foobar.com
changetype:modify
replace:userpassword
userpassword:new_password
|