[sprog-users] Announce: LDIF to Record
Status: Alpha
Brought to you by:
grantm
From: Chris B. <ch...@je...> - 2005-06-29 22:26:30
|
Hi all, This is the initial public release of a Gear to turn LDIF stanzas (as produced by e.g. OpenLDAP's ldapsearch) into records. It depends on Sprog::Gear::InputByPara to read \n\n-delimited stanzas. Available from http://jesmond.demon.co.uk/Sprog/ ------------------ NAME Sprog::Gear::LdifToRecord - parses an LDIF stream into records DESCRIPTION This gear parses an LDIF stream into records. Records should be sepa- rated by a blank line. This module assumes that the attribute names are separated from the value by ': '. The attributes of the entry are parsed into keys in the the hash record. Multi-valued attributes are stored in an array-reference which can be used in the Template gear like other template array variables: Alternate addresses: [% mailAlternateAddress.join %] [% FOREACH m IN mailAlternateAddress %] Alternate address: [% m; END %] ------------------ A useful combination is: Text Input (with the string to search for) -> Find and Replace (s/\s*$/\n/) # to ensure the string ends in \n -> Run Filter Command (ldapsearch -LLLx -f- 'cn=%s') -> LDIF to Record -> Apply Template ([% attributes %]) -> Text Window Best wishes -- Chris Benson |