CSV to LDIF Converter

0 Likes

This perl script will convert your CSV file into a formatted LDIF file for importing into LDAP. At a minimum you will need the objects DN.

The 3/10/05 revision corrects the handling of embedded commas, as well as the order of fields is now irrelevant.



Updated Nov. 9, 2006 by Bryan Green with permission of original author, Jody Greene.



  • Changed the input from command line arguments to user prompts (for our administrators, it was easier this way)

  • On both scripts, I've hard coded the LDIF version to a value of 1.

  • On both scripts, I've hard coded the changetype (fixdata2.pl is modify and adddata2.pl is add). I'm certainly not a Perl programmer but these could probably be combined to one script and the user prompted for the changetype.

  • The output file is now simply the input file name with .LDIF appended so that you can create multiple import files w/o having to rename fixdata.ldif.

Labels:

Collateral
Comment List
Anonymous
Related Discussions
Recommended