Data Import perl script

Hi,

I have a requirement for creating a Perl Script which will perform Data Import process in an automated way and I am elaborating herewith :

Section 1 )

  • use the following command line format :
    "./import.pl -h hostname -p port -f datafile.txt"

Section 2)

datafile.txt will contain data in LDAP format something like this :
dn: ou=CA, ou=abc, o=com
objectClass: top
objectClass: organizationalUnit
-----
----
Section 3)

# Perl script should be defined to include four commands as mentioned below, I am just looking out for format as I will using my own command as per the need.

1) (Command 1)First search should be made to find the first line having dn: and then pull value "CA" from ou=CA. Note: "dn:" may appear in subsequent lines as well but we should only be concerned about the first one.
2) (Command 2) The CA value will be used in a ldapsearch command to check whether the values exist in the database, if Yes.
3) (Command 3) Peform the second ldapmodify command to delete the ou=CA from the database.
4) (Command 4) once done, import the datafile.txt using ldapmodify command.

I believe you people can provide me some sample steps to accomplish this.

Regards,
Scott

school work is not allowed to be posted here

Hi Kevin,

I recieve your comments with an Honour, although you comments was TOO rude. If you dont how to help don't comment on people with a Template.

I am just looking for an startup help or link through which I can accomplish this. There are lot many GOOD people in this Forum.

Regards,
Scott

(6) Do not post classroom or homework problems.

The UNIX and Linux Forums - Forum Rules

Thread closed.