LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 08-17-2008, 05:52 PM   #1
ralinux
LQ Newbie
 
Registered: May 2006
Posts: 1

Rep: Reputation: 0
ldapsearch to csv file


HI,

Linux gurus please help me, I am stuck with a problem on how to process the data from ldapsearch.
I am exporting the data from ldap, using ldapsearch for the fields(dn,givenName,department,employeeNumber,employeeID,mail,manager) to user_dump.txt.
But I am getting the output for each field in a row list, instead of comma seperated.
The help I want is, convert the file to csv format.
1) get rid of any # lines
2) put each block as dn,givenName,department,employeeNumber,employeeID,mail,manager in a .csv file
3) I want the file to be imported into a oracle table.

sample output
===============
# Alex Fontana, Users, nbc.com
dn: CN=Ali Fon,CN=Users,DC=nbc,DC=com
givenName: Ali
department: Infrastructure - 19622
employeeNumber: 034636
employeeID: 034636
mail: a...@nbcc.com
manager: CN=Bob Plu,CN=Users,DC=nbc,DC=com

# Aravind Pavu, Users, nbc.com
dn: CN=Aravind Pavu,CN=Users,DC=nbc,DC=com
givenName: Aravind
department: R&D: Performance - 72200
employeeNumber: 035870
employeeID: 035870
mail: ap...@nbcc.com
manager: CN=Raji Kam,CN=Users,DC=nbc,DC=com

Thank you
ra
 
Old 08-18-2008, 12:34 PM   #2
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 14,762

Rep: Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613
Quote:
Originally Posted by ralinux View Post
HI,

Linux gurus please help me, I am stuck with a problem on how to process the data from ldapsearch.
I am exporting the data from ldap, using ldapsearch for the fields(dn,givenName,department,employeeNumber,employeeID,mail,manager) to user_dump.txt.
But I am getting the output for each field in a row list, instead of comma seperated.
The help I want is, convert the file to csv format.
1) get rid of any # lines
2) put each block as dn,givenName,department,employeeNumber,employeeID,mail,manager in a .csv file
3) I want the file to be imported into a oracle table.
Try this, ralinux:

http://www.yolinux.com/TUTORIALS/Lin...sAndTools.html

It specifically addresses exporting LDAP data to a CSV format.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert into CSV file say_hi_ravi Programming 4 07-17-2008 03:25 AM
Comparing two csv files and write different record in third CSV file irfanb146 Linux - Newbie 3 06-30-2008 09:15 PM
CSV file merge help lmedland Programming 2 06-04-2008 11:11 AM
help extracting data from csv file willinusf Linux - General 10 10-27-2006 09:10 PM
CSV File AMMullan Programming 2 11-10-2003 12:49 AM


All times are GMT -5. The time now is 08:55 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration