Microsoft KB Archive/308986

= Using $MAP_CHAR to Transform Unwanted Carriage Return and Linefeed Characters to Spaces =

Article ID: 308986

Article Last Modified on 1/25/2006

-

APPLIES TO


 * Microsoft Metadirectory Services 2.1
 * Microsoft Metadirectory Services 2.2 Service Pack 1
 * Microsoft Metadirectory Services 2.2 Service Pack 1

-



This article was previously published under Q308986



SUMMARY
Extraneous linefeed (hexadecimal value 0a, decimal value 10) and carriage return (hexadecimal value 0d, decimal value 13) characters may appear in text attributes that are received in Microsoft Metadirectory Services (MMS) Management Agent (MA) import files. One solution to this problem is to change the character or characters into spaces by using the $MAP_CHAR function. Although you cannot delete the unwanted characters, this transformation to a space is often sufficient.

Note: Although this article describes carriage return and linefeed characters only, the technique that is presented may be modified to handle any other characters.



MORE INFORMATION
The following code sample is based on the assumption that an import file has been parsed and that one of the attributes, cd.street, contains an unwanted linefeed character. The following template may be used to display the attribute's contents: $debug(&quot;ON&quot;) $v_message = $cd.street $debug(&quot;OFF&quot;) The following message would then be logged in the Zscript log during the MA execution:
 * 1) Correct Street

>> apply [$debug(&quot;ON&quot;)]

>> line #55 - set $v_message = [6240 Software Parkway

Building 3]

>> line #59 - Debug turned off

This following steps describe how to modify the value of the metaverse street attribute in the metaverse construction template is being modified. To make the transformation:  Using Compass, log on as an administrator. Navigate to the appropriate MA. Using the action on the left side of the screen, click Design MA. Click the Control MA Operations tab. Click the Template Definitions tab.  At the #others section, add the following text: s_substitution_char_10 10:32 s_substitution_char_13 13:32 The format is:

 Unique name</li> ASCII value of character to replace</li> A colon </li> ASCII value of replacement character</li></ol>

To find a complete explanation, refer to the online manual Microsoft Metadirectory Services: Management Agent Toolkit Manual, Appendix A: Template Definitions. </li> Click the Control Metadirectory tab.</li> Click the Construction Template tab.</li> Click the Metaverse tab.</li>  Add the following text to the indicated section of the template: $mv.street = $cd.street $mv.street = $MAP_CHAR ($mv.street) Note: Each MA has its own particular template instructions, so specific editing directions are not provided. </li> Click OK.</li></ol>

Additional query words: mms metadirectory zoomit

Keywords: kbinfo KB308986

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.