fMakeLDIF - Convert C V S files to LDIF

0 Likes

I often need to modify or add a lot of users and I get the data from
some system in cvs format. To quickly convert these data to ldif I
wrote this tool. I've only tested it on Windows but it should work
on Linux as well. Perl must be installed to make it work
since this is a perl script. Type makeldif.pl -h to get help:



Usage: makeldif.pl -t <template> -a <attrib> [-o <output>] [-s
<seperator>] [-h]



Options:

-t file   Template file. This file is the template of the LDIF
code to be generated. Use *1..*n as variables to be replaces
from the attribute file.



-a file   "Something"-separaded file with attributes to be
replaced by the variables in the template. Ie.:



                      attrib.txt file
---------------
user1;locationA


                      template.ldif file
------------------
dn: cn=*1,ou=users,o=myorg
changetype: modify
replace: l
l: *2


This will generate:



                      dn: cn=user1,ou=users,o=myorg
changetype: modify
replace: l
l: locationA


-o file   The file to write LDIF code to. If not specified it
will be written to <STDOUT>.



-s sep   The separator for the attribute file. If not
specified ';' will be used. Use tab for \t (tabulator) and space for
whitespace.


-h   Prints this help text.



Ie.: makeldif.pl -t template.file -a attrib.file -o new.ldif -s tab


Labels:

Collateral
Comment List
Anonymous
Related Discussions
Recommended