Previous Topic: Exit Status Codes for the DXtools

Next Topic: DXcertgen Tool—Generate and Work with Certificates

csv2ldif Tool—Create an LDIF File from a CSV File

Use the csv2ldif tool to create an LDIF file from a CSV file. You can then use the LDIF file as source input to DXmodify.

csv2ldif directs its output to standard output. To create an LDIF file, redirect the output to a file name.

This command has the following format:

csv2ldif options numfields LDTfile CSVfile
options

Denotes one or more of the following options:

-b badfile

Specifies the output file name for CSV lines with bad format.

-d

Permits duplicate parent nodes to be generated.

-f branching factor

Specifies the number of branching factors. The default is 32.

Note: This is a low-level option. Do not use it unless you are told to by CA Technical Support.

-i Numberoflines

Ignores the first NumberofLines lines of the CSV file.

-s sep

Defines a field separator (default is a comma)

numfields

Specifies the total number of fields defined in the input CSV file.

LDTfile

Specifies the name of the LDT file.

CSVfile

Specifies the name of the input CSV file.

Example: Convert Sample CSV Data Using an LDT File

The following command uses the csv2ldif utility to convert CSV data to LDIF:

csv2ldif -i 1 7 acme.ldt acme.csv > acme.ldi

The output is redirected to the acme.ldi file. The following is a portion of acme.ldi:

dn: o=Acme, c=US
oc: organization
dn: ou=Administration, o=Acme, c=US
oc: organizationalUnit
dn: cn=Fred Jones, ou=Administration, o=Acme, c=US
oc: organizationalPerson
postalAddress: 11 Main Street $ Newtown
surname: Jones
title: Manager
telephonenumber: +1 (123) 456 7890
telephonenumber: +1 (987) 654 3210
dn: ou=Sales, o=Acme, c=US
oc: organizationalUnit

Telephonenumber appears twice because it is a multi-valued attribute

More information:

The Format of LDT files