Inserting Text into ldif file

I have an ldif file that has the dn: on one line and an attribute (pabURI) and value (unique to each user) on another line.

I need to inset in between each a changetype and a replace lines

I'm more of a windows users, and unsure of how to easily accomplish this. I have a perl script that was given to me that did something similar but could not get it to work in this case.

The script I had was perl -e'while(<>)[chomp;next unless ($_!~m#^$#i); print "$_\nchangetype: modify\nreplace: mailquota\nmailquota: 31440000\n\n;} file.ldif > file2.ldif

I used it to take a listing of dn:'s and add a changetype and replace after each in order to change the quotas for all the users, the problem here however is that the change I need to make is unique to each user so I must have the attribute/value lines in there as well.

Any help, or another way of doign it woudl be appreciated, thanks.

Bill

[952 byte] By [bcubed55] at [2007-11-26 6:15:04]
# 1
You may search Google for "csv2ldif", and see if you could make use of the tools found.Gary
GaryTay at 2007-7-6 13:53:36 > top of Java-index,Java Enterprise System,Java Enterprise System - Installation, Upgrade and Migration...
# 2

Hey Gary,

I've read some of your stuff on the internet and it sounds like you have a little experience at this ldap stuff. I'm fairly new to it and I could sure use your help. I just need to figure out how to get a Fedora 4 client to automount it's home dir from the directory tree, but I'm not using tls and ssl. I'm using simple and crypted.

I followed the suned book from the class my colleague took to the letter and everything is working fine, but I have since discovered that there are no standards or rfc's for automounting in ldap and I have spent enough time already trying to get this setup to work. I don't want to have to switch horses and start using open ldap but if I have to I will.

My client is asking to migrate over 50 NIS Solaris/Linux clients to LDAP and he's getting anxious because he doesn't have the budget to keep me here fiddling around with this thing forever trying to get it to work. Can I maybe call you and/or email you about this because I'm getting nowhere with the help that's out there on google? Thanks Gary.

hardware_man at 2007-7-6 13:53:36 > top of Java-index,Java Enterprise System,Java Enterprise System - Installation, Upgrade and Migration...
# 3

See:

<a href="http://supportforum.sun.com/sjes/index.php?t=msg&amp;th=773&amp;s tart=0&amp;rid=11391&amp;SQ=e401d74c8961b77d3597a30c4f57cfcc" target="_blank"> http://supportforum.sun.com/sjes/index.php?t=msg&th=773& amp;start=0&rid=11391&SQ=e401d74c8961b77d3597a30c4f5 7cfcc</a>

Gary

GaryTay at 2007-7-6 13:53:36 > top of Java-index,Java Enterprise System,Java Enterprise System - Installation, Upgrade and Migration...