Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Wrtiting to a file in LDIF format

Reply
Thread Tools

Wrtiting to a file in LDIF format

 
 
dakin999
Guest
Posts: n/a
 
      06-19-2008
Hi, I am trying to write to a file elements of an array. The output I
want is simple LDIF format like this:

dn:uid=xxx,cn=yyy,cn=zzz,O=xyz,C=OO
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
objectClass: top

Has some one done something like this using "sprintf" or any other
method?? . Any snippet will be really helpful....
 
Reply With Quote
 
 
 
 
dakin999
Guest
Posts: n/a
 
      06-19-2008
On Jun 19, 11:33*am, David Filmer <(E-Mail Removed)> wrote:
> dakin999 wrote:
> > Hi, I am trying to write to a file elements of an array. *The output I
> > want is simple LDIF

>
> That wheel has already been invented for you:
>
> * *http://search.cpan.org/~leifhed/perldap-1.4/LDIF.pm
>
> --
> David Filmer (http://DavidFilmer.com)
> The best way to get a good answer is to ask a good question.


Yes, I am aware of the this. But I need to construct the LDIF file
first before exporting the data into the LDAP server.
 
Reply With Quote
 
 
 
 
Martijn Lievaart
Guest
Posts: n/a
 
      06-19-2008
On Wed, 18 Jun 2008 19:52:55 -0700, dakin999 wrote:

> On Jun 19, 11:33*am, David Filmer <(E-Mail Removed)> wrote:
>> dakin999 wrote:
>> > Hi, I am trying to write to a file elements of an array. *The output
>> > I want is simple LDIF

>>
>> That wheel has already been invented for you:
>>
>> * *http://search.cpan.org/~leifhed/perldap-1.4/LDIF.pm
>>
>> --
>> David Filmer (http://DavidFilmer.com) The best way to get a good answer
>> is to ask a good question.

>
> Yes, I am aware of the this. But I need to construct the LDIF file first
> before exporting the data into the LDAP server.


That's what it does, look under the heading Output.

M4
 
Reply With Quote
 
dakin999
Guest
Posts: n/a
 
      06-19-2008
On Jun 19, 4:35*pm, Martijn Lievaart <(E-Mail Removed)> wrote:
> On Wed, 18 Jun 2008 19:52:55 -0700, dakin999 wrote:
> > On Jun 19, 11:33*am, David Filmer <(E-Mail Removed)> wrote:
> >> dakin999 wrote:
> >> > Hi, I am trying to write to a file elements of an array. *The output
> >> > I want is simple LDIF

>
> >> That wheel has already been invented for you:

>
> >> * *http://search.cpan.org/~leifhed/perldap-1.4/LDIF.pm

>
> >> --
> >> David Filmer (http://DavidFilmer.com) The best way to get a good answer
> >> is to ask a good question.

>
> > Yes, I am aware of the this. But I need to construct the LDIF file first
> > before exporting the data into the LDAP server.

>
> That's what it does, look under the heading Output.
>
> M4- Hide quoted text -
>
> - Show quoted text -


Sorry for the confusion, but I am just looking to create a output LDIF
file without doing anything after that. (No loading to LDAP server,
etc. just a plain LDIF file in the format I mentioned at the top).
 
Reply With Quote
 
dakin999
Guest
Posts: n/a
 
      06-19-2008
On Jun 19, 4:35*pm, Martijn Lievaart <(E-Mail Removed)> wrote:
> On Wed, 18 Jun 2008 19:52:55 -0700, dakin999 wrote:
> > On Jun 19, 11:33*am, David Filmer <(E-Mail Removed)> wrote:
> >> dakin999 wrote:
> >> > Hi, I am trying to write to a file elements of an array. *The output
> >> > I want is simple LDIF

>
> >> That wheel has already been invented for you:

>
> >> * *http://search.cpan.org/~leifhed/perldap-1.4/LDIF.pm

>
> >> --
> >> David Filmer (http://DavidFilmer.com) The best way to get a good answer
> >> is to ask a good question.

>
> > Yes, I am aware of the this. But I need to construct the LDIF file first
> > before exporting the data into the LDAP server.

>
> That's what it does, look under the heading Output.
>
> M4- Hide quoted text -
>
> - Show quoted text -


Sorry, I forget to mention, I am using perl-ldap, not the mozilla....
 
Reply With Quote
 
Martijn Lievaart
Guest
Posts: n/a
 
      06-19-2008
On Thu, 19 Jun 2008 01:09:19 -0700, dakin999 wrote:

> Sorry for the confusion, but I am just looking to create a output LDIF
> file without doing anything after that. (No loading to LDAP server, etc.
> just a plain LDIF file in the format I mentioned at the top).


I would say perldap-1.4 can do exactly that. Where exactly does it not
meet your needs?

M4
 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Python3] Reading a binary file and wrtiting the bytes verbatim in an utf-8 file Python 6 04-25-2010 07:46 AM
Reading - Parsing Records From An LDAP LDIF File In .Net? jeangv@gmail.com ASP .Net 0 06-08-2006 10:02 PM
Packet wrtiting problem John Rampling Computer Information 1 04-21-2005 09:28 AM
Wrtiting AVI files with Python JamesT Python 1 07-30-2003 08:01 AM



Advertisments