This may be already answered. But i couldn't able to find any good material online or on stackoverflow. I am trying to parse the below LDIF file and write it to a new file removing some DN in the file. i saw LDIFParser, LDIFWriter and some examples. But not a good one. Can some one throw some light here.or any online materials
dn: uid=rasannak,ou=people,dc=LNU,dc=edu
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
objectclass: peoplefinderPerson
givenname: rasanna
cn: rasanna Kumaravel
sn: rasanna
telephoneNumber: +1 (314) 9777777
mail: [email protected]
uid: prasannak
title: Executive Assistant to the President and Board Administrator
campus: view Campus
building: Day Hall
room: 206
status: Faculty/Staff
ou: Office
physicalDeliveryOfficeName: Day Hall
The example you are looking for is provided on: https://www.python-ldap.org/en/python-ldap-3.3.0/reference/ldif.html. Scroll to the end of the page.
Goes like this: