Data Import perl script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Data Import perl script
# 1  
Old 02-03-2009
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
# 2  
Old 02-03-2009
school work is not allowed to be posted here
# 3  
Old 02-03-2009
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
# 4  
Old 02-03-2009
(6) Do not post classroom or homework problems.

The UNIX and Linux Forums - Forum Rules

Thread closed.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Using bash script : How to Import data from a dsv file into multiple tables in mysql

HI I have a dsv file that looks like: <<BOF>> record_number|id_number|first name|last name|msisdn|network|points|card number|gender 312|9101011234011|Test Junior|Smith|071 123 4321|MTN|73|1241551413214444|M 313|9012023213011|Bob|Smith|27743334321|Vodacom|3|1231233232323244|M... (4 Replies)
Discussion started by: tera
4 Replies

2. Shell Programming and Scripting

In PErl script: need to read the data one file and generate multiple files based on the data

We have the data looks like below in a log file. I want to generat files based on the string between two hash(#) symbol like below Source: #ext1#test1.tale2 drop #ext1#test11.tale21 drop #ext1#test123.tale21 drop #ext2#test1.tale21 drop #ext2#test12.tale21 drop #ext3#test11.tale21 drop... (5 Replies)
Discussion started by: Sanjeev G
5 Replies

3. Shell Programming and Scripting

Data to import the database as snippets

Hi all, I don't know if this the right place to post my question to get some ideas on how to done this. I have a text files extracted from OCR that need to have snippets to be import to database as snippet table which have columns "snippet, date, title" I dont know if shell scripts can do it... (11 Replies)
Discussion started by: lxdorney
11 Replies

4. Shell Programming and Scripting

Script to extract data from Active Directory and import in Zimbra Ldap

Hello Experts, I have this specific requirment where i need to download/extract from AD (Firstname, LastName, etc) and upload the same to Ldap used by Zimbra mail server running on Suse Linux. I know how to manually do that, but that is the not the solution. I am not yet sure on how to start... (3 Replies)
Discussion started by: Siddheshk
3 Replies

5. Shell Programming and Scripting

How can I do one liner import multiple custom .pm files in my perl script?

I am new for Perl I want to ask one question. I have around 50 custom packages which i am using in my Perl script. I want to import all .pm packages in my Perl script in an easy way. Right now i have to import each package individually. So Is there any way to do so?? Right Now i am doing like: ... (1 Reply)
Discussion started by: Navrattan Bansa
1 Replies

6. Shell Programming and Scripting

shellscript to read data from txt file and import to oracle db

Hi all, Help needed urgently. I am currently writing a shellscript to read data/record from a flat file (.txt) file, and import/upload the data to oracle database. The script is working fine, but it takes too long time (for 18000 records, it takes around 90 mins). I guess it takes so long... (1 Reply)
Discussion started by: robot_mas
1 Replies

7. Solaris

import lun data to mount point - Solaris 10

Hi Guys, I have EMC Storage and from this storage I have maped lun5 to Sun Solaris server and I have created on this lun mount point with name /application I have anothere Sun Solaris server and I'll colne lun5 to lun10 from storage level so the data of lun5 will be in lun10 how to... (6 Replies)
Discussion started by: Mr.AIX
6 Replies

8. UNIX for Dummies Questions & Answers

How can import data files to XL sheet.

Hi, I have the file(F1.XL) in Unix Box. it's updating every 1hr. I would like to import f1.xl to Windows excel sheet, when i need see the reports. can any one clarify, is there any VB script for importing data from UNIX, like sql connection.... thanks (1 Reply)
Discussion started by: koti_rama
1 Replies

9. Windows & DOS: Issues & Discussions

import data files from Unix to Windows?

Hi, Is there any way to import data files from Unix system to Windows system? I have many data files on Unix machine generated every night. I need to pick certain data from each file and plug them into this windows file on the network share drive. Anyone has any idea? Thanks in advance! (8 Replies)
Discussion started by: whatisthis
8 Replies

10. Shell Programming and Scripting

Import data from compressed file

HI I need to import data from a file which is in comressed format but system doesn't have enough space to uncompress file Is there any way so that i can do import from compressed file. (4 Replies)
Discussion started by: ap_gore79
4 Replies
Login or Register to Ask a Question