[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Converting to LDIF



Sandeep Casi wrote:

> Has anybody written a perl or a shell script that would take an ascii file
> containing person information and convert that info a ldif file.

A component that's useful for the purpose is the Mozilla::LDAP::LDIF package.
Not the released version, but '-r devel-branch-1_3' (in CVS).  It's part of
PerLDAP, but you can use the LDIF package alone (without the rest of
PerLDAP).  For details, see
http://www.mozilla.org/directory/faq/perldap-faq.html#_src_3  Or I'll send you
a copy of the Perl module, if you like (it's a little too big to post here).

But Mozilla::LDAP::LDIF won't help you parse your input file; it merely
converts from a Perl structure to LDIF format (or vice-versa).  And LDIF isn't
very complicated.  So if your data are pretty simple, and you're only going to
do this once (are you sure? :-), you'd probably get done quicker by just
hacking away.

LDIF is defined by the Internet Draft <draft-good-ldap-ldif-03>.