robartes has asked for the wisdom of the Perl Monks concerning the following question:
I've run into something that might result in serious hair loss. Here's what:
I'm working in a 2Gb+ file in LDIF format (for an LDAP user database I'm populating) where I need to replace parts of the DN's of the users. E.g.:
needs to become:cn=Perl Monks,ou=Dining Hall,ou=Monastery,c=Universe
Not a problem, I says, just search and replace the thing, and await happiness, joy and bliss everafter. Well, no. It turns out that the input file has a line length of 80 chars, and enforces it: there's a newline character in pos 80 if the line is longer than 80 charachters. Very inconvenient, of course, as for long DN's this might mean that it actually says:cn=Perl Monks,ou=Bedchambers,ou=Monastery,c=Universe
And those things are not matched by a simple regular expression, as the newline can appear just about anywhere in the DN (apparently, this is not a problem for the tools I will use later down the line to import the users).cn=Perl Monks,ou=Dining H\nall,ou=Monastery,c=Universe
Some things I can think of doing to remedy this:
CU
Robartes-
|
|---|