Yang, Tong 3f5759eed2 MRS comp-lts 2.0.38.SP20 version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Yang, Tong <yangtong2@huawei.com>
Co-committed-by: Yang, Tong <yangtong2@huawei.com>
2023-01-19 17:08:45 +00:00

54 lines
7.2 KiB
HTML

<a name="mrs_01_1142"></a><a name="mrs_01_1142"></a>
<h1 class="topictitle1">String Trim</h1>
<div id="body8662426"><div class="section" id="mrs_01_1142__en-us_topic_0000001173470758_sf3e2679fe5b742bba3844dc16f1f828d"><h4 class="sectiontitle">Overview</h4><p id="mrs_01_1142__en-us_topic_0000001173470758_a01f46cbaf28549c5bf29ef08161faf98">The <span class="parmname" id="mrs_01_1142__en-us_topic_0000001173470758_pd8f20913e6ae4454a3b7bc877c26a673"><b>String Trim</b></span> operator clears spaces contained in existing fields to generate new fields.</p>
</div>
<div class="section" id="mrs_01_1142__en-us_topic_0000001173470758_s6460807f3721457fa6dbdba9985657b8"><h4 class="sectiontitle">Input and Output</h4><ul id="mrs_01_1142__en-us_topic_0000001173470758_u0378cc13b3c8463dac0a4a9ef2184c8b"><li id="mrs_01_1142__en-us_topic_0000001173470758_ld8da7facedde43069a7c4c03832e4736">Input: fields whose spaces are to be cleared</li><li id="mrs_01_1142__en-us_topic_0000001173470758_l2bcf30a1451a46cfbba1a30b1d3e37f6">Output: new fields</li></ul>
</div>
<div class="section" id="mrs_01_1142__en-us_topic_0000001173470758_s3a84ee66c0e44767b1451be44ea0015b"><h4 class="sectiontitle">Parameter Description</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="mrs_01_1142__en-us_topic_0000001173470758_t80f11f25710c43bc853c6dbe6e084d4a" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Operator parameter description</caption><thead align="left"><tr id="mrs_01_1142__en-us_topic_0000001173470758_r12eae78ce0ee42edb2d9980eb3173b0c"><th align="left" class="cellrowborder" valign="top" width="18.37%" id="mcps1.3.3.2.2.6.1.1"><p id="mrs_01_1142__en-us_topic_0000001173470758_a45ef69ae8c7f44dd951290b96027d383">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="54.730000000000004%" id="mcps1.3.3.2.2.6.1.2"><p id="mrs_01_1142__en-us_topic_0000001173470758_a20f1bb8d082945c3ba939bfbbb1b65d2">Description</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.3.3.2.2.6.1.3"><p id="mrs_01_1142__en-us_topic_0000001173470758_ac692897efa8a4e7e873853ea05aacadd">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="9.69%" id="mcps1.3.3.2.2.6.1.4"><p id="mrs_01_1142__en-us_topic_0000001173470758_a7df6ec52945443c88966be520f39bbdd">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="9.69%" id="mcps1.3.3.2.2.6.1.5"><p id="mrs_01_1142__en-us_topic_0000001173470758_a902b5da560a04812a98dddcc16b3e9b4">Default Value</p>
</th>
</tr>
</thead>
<tbody><tr id="mrs_01_1142__en-us_topic_0000001173470758_r529afb76f11743edac128bfb15cd1b4f"><td class="cellrowborder" valign="top" width="18.37%" headers="mcps1.3.3.2.2.6.1.1 "><p id="mrs_01_1142__en-us_topic_0000001173470758_a7da11e09c3f74edb8a47654ac62d6ac3">Fields to be trimmed</p>
</td>
<td class="cellrowborder" valign="top" width="54.730000000000004%" headers="mcps1.3.3.2.2.6.1.2 "><p id="mrs_01_1142__en-us_topic_0000001173470758_a7c2a15c967d143c8938d3b7a89ce5d9a">Information about fields for clearing spaces contained in strings:</p>
<ul id="mrs_01_1142__en-us_topic_0000001173470758_u6963e3d6e0ff469aa73190c457e6dab1"><li id="mrs_01_1142__en-us_topic_0000001173470758_l7b0d67f2f83a4d75a8fc275f27613ffd"><span class="parmname" id="mrs_01_1142__en-us_topic_0000001173470758_p968959eeb4804986bbb9a7ff6434be31"><b>input field name</b></span>: Names of input fields. Set this parameter to the names of fields generated in the previous conversion step.</li><li id="mrs_01_1142__en-us_topic_0000001173470758_l17bc6fa5e0d1401bb7b9a446e687d400"><span class="parmname" id="mrs_01_1142__en-us_topic_0000001173470758_pf0a3c0163c5f45f7897d2cb1f3d0d07a"><b>output field name</b></span>: Names of output fields.</li><li id="mrs_01_1142__en-us_topic_0000001173470758_lec54a4b6681f4d15abda38c37da09326"><span class="parmname" id="mrs_01_1142__en-us_topic_0000001173470758_p1db8f2b2a33f4197a2c191710e7d3361"><b>trim type</b></span>: Space clearing mode (clearing starting spaces, ending spaces, or starting and ending spaces).</li></ul>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.3.3.2.2.6.1.3 "><p id="mrs_01_1142__en-us_topic_0000001173470758_a4b95e23eb870476fbecc33b4fba7247a">map</p>
</td>
<td class="cellrowborder" valign="top" width="9.69%" headers="mcps1.3.3.2.2.6.1.4 "><p id="mrs_01_1142__en-us_topic_0000001173470758_ab8e7e6c7cf2743528b6f324ee191ae62">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="9.69%" headers="mcps1.3.3.2.2.6.1.5 "><p id="mrs_01_1142__en-us_topic_0000001173470758_a30261a2f77264cd7b1045dd4f23759d3">None</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="mrs_01_1142__en-us_topic_0000001173470758_s7f42a3c2cd2d45dfab104bbe2bf01e5b"><h4 class="sectiontitle">Data Processing Rule</h4><ul id="mrs_01_1142__en-us_topic_0000001173470758_u5e14edc7c26f4ee6b31e9a923f06b7d1"><li id="mrs_01_1142__en-us_topic_0000001173470758_l13cf7481d0604788ae7a5b62043178cd">Clearing spaces at both ends of a value supports clearing spaces at the left end, at the right end, and at both ends.</li><li id="mrs_01_1142__en-us_topic_0000001173470758_l7cda607c7fde4e748fdf99009a48f24f">If the input data is null, no conversion is performed.</li><li id="mrs_01_1142__en-us_topic_0000001173470758_lcbd04a35b4eb401aa9dafa386a3b6df1">If the number of input field columns is greater than the number of field columns actually included in the original data, all data becomes dirty data.</li></ul>
</div>
<div class="section" id="mrs_01_1142__en-us_topic_0000001173470758_s1a47158cbdc64e318ab3d1286aa94963"><h4 class="sectiontitle">Example</h4><p id="mrs_01_1142__en-us_topic_0000001173470758_a34d004f6fca24fe181ef42557383bdf0">Use the <span class="parmname" id="mrs_01_1142__en-us_topic_0000001173470758_pf9254cfa23f34d7ab8d38477964e5311"><b>CSV File Input</b></span> operator to generate fields A, B, and C.</p>
<p id="mrs_01_1142__en-us_topic_0000001173470758_a56b54a06c55b4305ae786d1db5ad5202">The following figure shows the source file.</p>
<p id="mrs_01_1142__en-us_topic_0000001173470758_a91102481e2464df790baceda65d11560"><span><img id="mrs_01_1142__en-us_topic_0000001173470758_i7de1a15053b7468cb3448cfb008f000d" src="en-us_image_0000001296219724.jpg"></span></p>
<p id="mrs_01_1142__en-us_topic_0000001173470758_af68d5992f9734347af13af4c8c2d8641">Configure the <span class="parmname" id="mrs_01_1142__en-us_topic_0000001173470758_p792949b58e19404898f02ffa21822387"><b>String Trim</b></span> operator to generate three new fields D, E, and F.</p>
<p id="mrs_01_1142__en-us_topic_0000001173470758_ab086a82e6c52408ca9e74ef567e43541"><span><img id="mrs_01_1142__en-us_topic_0000001173470758_i3738df23e2fe484395bdc1171a75a96f" src="en-us_image_0000001295740292.png"></span></p>
<p id="mrs_01_1142__en-us_topic_0000001173470758_a2d29efd32a3e4474999f0b1fcd04d5c3">Six fields are generated, as shown in the following figure.</p>
<p id="mrs_01_1142__en-us_topic_0000001173470758_a2a5b8a9fe8974a30b186af5ef8aee4ea"><span><img id="mrs_01_1142__en-us_topic_0000001173470758_i7cb0baac6b7946808e0423fd07921b81" src="en-us_image_0000001349139809.jpg"></span></p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_1130.html">Conversion Operators</a></div>
</div>
</div>