Wrtiting to a file in LDIF format

Discussion in 'Perl Misc' started by dakin999, Jun 19, 2008.

  1. dakin999

    dakin999 Guest

    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....
     
    dakin999, Jun 19, 2008
    #1
    1. Advertising

  2. dakin999

    dakin999 Guest

    On Jun 19, 11:33 am, David Filmer <> 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.
     
    dakin999, Jun 19, 2008
    #2
    1. Advertising

  3. On Wed, 18 Jun 2008 19:52:55 -0700, dakin999 wrote:

    > On Jun 19, 11:33 am, David Filmer <> 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
     
    Martijn Lievaart, Jun 19, 2008
    #3
  4. dakin999

    dakin999 Guest

    On Jun 19, 4:35 pm, Martijn Lievaart <> wrote:
    > On Wed, 18 Jun 2008 19:52:55 -0700, dakin999 wrote:
    > > On Jun 19, 11:33 am, David Filmer <> 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).
     
    dakin999, Jun 19, 2008
    #4
  5. dakin999

    dakin999 Guest

    On Jun 19, 4:35 pm, Martijn Lievaart <> wrote:
    > On Wed, 18 Jun 2008 19:52:55 -0700, dakin999 wrote:
    > > On Jun 19, 11:33 am, David Filmer <> 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....
     
    dakin999, Jun 19, 2008
    #5
  6. 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
     
    Martijn Lievaart, Jun 19, 2008
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    542
  2. JamesT

    Wrtiting AVI files with Python

    JamesT, Jul 29, 2003, in forum: Python
    Replies:
    1
    Views:
    461
    Anand Pillai
    Jul 30, 2003
  3. Guest
    Replies:
    6
    Views:
    1,757
    Guest
    Apr 25, 2010
  4. Replies:
    2
    Views:
    181
  5. Replies:
    2
    Views:
    208
Loading...

Share This Page