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
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. Windows & DOS: Issues & Discussions
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
3. UNIX for Dummies Questions & Answers
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
4. Solaris
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
5. Shell Programming and Scripting
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
6. Shell Programming and Scripting
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
7. Shell Programming and Scripting
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
8. Shell Programming and Scripting
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
9. Shell Programming and Scripting
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
10. UNIX for Beginners Questions & Answers
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
LEARN ABOUT CENTOS
geoiplookup
GEOIPLOOKUP(1) General Commands Manual GEOIPLOOKUP(1)
NAME
geoiplookup - look up country using IP Address or hostname
SYNOPSIS
geoiplookup [-d directory] [-f filename] [-v] <ipaddress|hostname>
DESCRIPTION
geoiplookup uses the GeoIP library and database to find the Country that an IP address or hostname originates from.
For example
geoiplookup 80.60.233.195
will find the Country that 80.60.233.195 originates from, in the following format:
NL, Netherlands
OPTIONS
-f Specify a custom path to a single GeoIP datafile.
-d Specify a custom directory containing GeoIP datafile(s). By default geoiplookup looks in /usr/share/GeoIP
-v Lists the date and build number for the GeoIP datafile(s).
AUTHOR
Written by T.J. Mather
REPORTING BUGS
Report bugs to <support@maxmind.com>
COPYRIGHT
Copyright (C) 2006 MaxMind, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU-
LAR PURPOSE.
SEE ALSO
geoipupdate(1), nslookup(1).
4th Berkeley Distribution 2 Jan 2007 GEOIPLOOKUP(1)