It seems that ldapsearch is limited to returning it's output in just 80 chars. This is in accordance with the RFC specification written long ago for the ldap protocol, making it easier to work with terminal output. Some newer clients support optional operators like -T or -r to allow for unlmited columns ("no-wrap") , but it's not officially part of the specification, so most do not. Most notably, the ldapsearch provided as part of windows, and with all Oracle installations does not include any of these options. So this can be particularly frustrating to deal with. To get around this problem, you can do the following:
1. export your data to an ldif file using ldapsearch
2. Notice that in addition to limiting to 80 chars, the wrapped lines all include a 1-char space indent. This is how you can tell an actual new line, from a wrapped line (this is also in accordance with the spec, it's how ldapadd/ldapmodify know how to proccess the entries).
3. So knowing this, it's then very simple to use a tool that support carriage-return search and replace (like Ultra Edit), to replace the carriage return plus 1 space, with nothing. So in ultra edit search for "^p " (omit the quotes), to unwrap the lines.
This will put all your entries on one line each, making it much more readable and maintainable. The resulting file with the longer columns is still supported for import by ldapadd/ldapmodify. It's not pretty, but it works very well.
Monday, February 1, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment