Don't ask to ask, just ask | |
PerlMonks |
Net::LDAP::LDIF->new Chokes on large LDIF because of comments every 5k linesby 3dbc (Monk) |
on Dec 27, 2017 at 17:06 UTC ( [id://1206277]=perlquestion: print w/replies, xml ) | Need Help?? |
3dbc has asked for the wisdom of the Perl Monks concerning the following question: Original post: Hi Perl Monks,Trying to figure out a way to do an my $ldif = Net::LDAP::LDIF->new( "../packages/ldapsearch.ldif", "r") or die "file not exits\n"; on the output of an exec qx[customldapsearch_from_vendor command]. I want to use perl to process the large ldif it creates and format it into a csv report. Have most of it done, but want to be able to dynamically control the exec win32 command from perl and then immediately pass the output into the new LDAP LDIF. Right now the exec doesn't release the file so I can than process it in perl through the ldif call and I'm getting an error when opening the file. Thanks!! Hi Perl Monks, Having an issue reading in a huge LDIF with comments every 5 thousand lines, how do I ignore those when opening the ldif with net::LDAP::ldif->new? example of LDIF with comments: Do I have to parse these out of the ldif before reading it in with net ldap ldif? Right now it's reading in the file it generates but only gets like a quarter of the way through it then throws an error entry not valid on the line with this: $entry = $ldif->read_entry() Shouldn't NET LDAP LDIF conform to the standard UPDATE: Never mind found out my own issue, as you can see in the comments section every 5k lines it has one un-commented line in the middle. so the ldif I'm using doesn't conform to the standard. wish I could use LDIF module to create the ldif, but need to page the results every 1k search results. 2017-12-28 Athanasius restored original content and added code tags
- 3dbc
Back to
Seekers of Perl Wisdom
|
|