forked from docs/doc-exports
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>
108 lines
15 KiB
HTML
108 lines
15 KiB
HTML
<a name="mrs_01_1122"></a><a name="mrs_01_1122"></a>
|
|
|
|
<h1 class="topictitle1">CSV File Input</h1>
|
|
<div id="body8662426"><div class="section" id="mrs_01_1122__en-us_topic_0000001173789228_sfbcaac020568405e8ccc930681939fd9"><h4 class="sectiontitle">Overview</h4><p id="mrs_01_1122__en-us_topic_0000001173789228_a35f29125ccf44ea9b07278b325100edd">The <span class="parmname" id="mrs_01_1122__en-us_topic_0000001173789228_p644878e92ca941b9b37aaa331ca1e8ba"><b>CSV File Input</b></span> operator imports all files that can be opened by using a text editor.</p>
|
|
</div>
|
|
<div class="section" id="mrs_01_1122__en-us_topic_0000001173789228_s164c8a244eca4a5fb2b0038bf3f7fdeb"><h4 class="sectiontitle">Input and Output</h4><ul id="mrs_01_1122__en-us_topic_0000001173789228_u35a033b91ae6473ea0b948c3c9564208"><li id="mrs_01_1122__en-us_topic_0000001173789228_lcba5d0e76dec4cb191c23bc9d4b18e25">Input: test files</li><li id="mrs_01_1122__en-us_topic_0000001173789228_l81a43658b7ad4567a9f44b6e63997f87">Output: fields</li></ul>
|
|
</div>
|
|
<div class="section" id="mrs_01_1122__en-us_topic_0000001173789228_s98e43f83586941d3b4e7df5c553c2f7e"><h4 class="sectiontitle">Parameter Description</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="mrs_01_1122__en-us_topic_0000001173789228_tbc08aa5eb50348448a752a1cb4c61448" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Operator parameter description</caption><thead align="left"><tr id="mrs_01_1122__en-us_topic_0000001173789228_re321ab7cb7724331b8b639edf5a8a27b"><th align="left" class="cellrowborder" valign="top" width="16.11%" id="mcps1.3.3.2.2.6.1.1"><p id="mrs_01_1122__en-us_topic_0000001173789228_af829c4557fb141718733374b30ad4fce">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="43.24%" id="mcps1.3.3.2.2.6.1.2"><p id="mrs_01_1122__en-us_topic_0000001173789228_a05707e1158984a7cb03d17ae9ea35887">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="11.21%" id="mcps1.3.3.2.2.6.1.3"><p id="mrs_01_1122__en-us_topic_0000001173789228_a292dde1ac8ab46b7a32f4c8df96e6863">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="16.48%" id="mcps1.3.3.2.2.6.1.4"><p id="mrs_01_1122__en-us_topic_0000001173789228_a03e925534516486397b9e1c75ae0511b">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="12.959999999999999%" id="mcps1.3.3.2.2.6.1.5"><p id="mrs_01_1122__en-us_topic_0000001173789228_a466cb899427c41d0bcb5f545728bb405">Default Value</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="mrs_01_1122__en-us_topic_0000001173789228_rf1b97b1097484b51990083d48cf728ed"><td class="cellrowborder" valign="top" width="16.11%" headers="mcps1.3.3.2.2.6.1.1 "><p id="mrs_01_1122__en-us_topic_0000001173789228_a21ba648513ce464ab1cbe30071943028">Delimiter</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.24%" headers="mcps1.3.3.2.2.6.1.2 "><p id="mrs_01_1122__en-us_topic_0000001173789228_a6f42d64d5fe846d898bf7f75ec240118">Delimiter in a CSV file for separating data lines.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="11.21%" headers="mcps1.3.3.2.2.6.1.3 "><p id="mrs_01_1122__en-us_topic_0000001173789228_a558cba6c412b411ca508a44bf87b3cfe">string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.48%" headers="mcps1.3.3.2.2.6.1.4 "><p id="mrs_01_1122__en-us_topic_0000001173789228_af0608699bda34ba4abec02aae03e0f31">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.959999999999999%" headers="mcps1.3.3.2.2.6.1.5 "><p id="mrs_01_1122__en-us_topic_0000001173789228_ac164c1d2eb7646398815cabf70d3b099">,</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_01_1122__en-us_topic_0000001173789228_r327d28de094b4eb8a4cdcb413b00ed63"><td class="cellrowborder" valign="top" width="16.11%" headers="mcps1.3.3.2.2.6.1.1 "><p id="mrs_01_1122__en-us_topic_0000001173789228_a139aa40b21104ff594a773781f4a1ff7">Line Delimiter</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.24%" headers="mcps1.3.3.2.2.6.1.2 "><p id="mrs_01_1122__en-us_topic_0000001173789228_a0c24324b69af484fa3a2f8ef876f6e21">Line delimiter, which can be any string specified by users based on the actual situation. The OS line delimiter is used by default.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="11.21%" headers="mcps1.3.3.2.2.6.1.3 "><p id="mrs_01_1122__en-us_topic_0000001173789228_a395b506211b245a88848b5e2763f56ef">string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.48%" headers="mcps1.3.3.2.2.6.1.4 "><p id="mrs_01_1122__en-us_topic_0000001173789228_a7d36ba0d7af2444680b6a5812e56c615">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.959999999999999%" headers="mcps1.3.3.2.2.6.1.5 "><p id="mrs_01_1122__en-us_topic_0000001173789228_ac9ad1f3df0c3421fb0f285c109c80326">\n</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_01_1122__en-us_topic_0000001173789228_ra4a7224ea54c421a810f244b0fbcf914"><td class="cellrowborder" valign="top" width="16.11%" headers="mcps1.3.3.2.2.6.1.1 "><p id="mrs_01_1122__en-us_topic_0000001173789228_abab3188d94bc4e64af1d4fd48baa2498">Filename as field</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.24%" headers="mcps1.3.3.2.2.6.1.2 "><p id="mrs_01_1122__en-us_topic_0000001173789228_a9f8245515e03483e8e7176dca905e6c0">User-defined field whose value is the name of the file that stores the current data.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="11.21%" headers="mcps1.3.3.2.2.6.1.3 "><p id="mrs_01_1122__en-us_topic_0000001173789228_a2e5a4c9f5dba42fd9cb0c7e808abce77">string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.48%" headers="mcps1.3.3.2.2.6.1.4 "><p id="mrs_01_1122__en-us_topic_0000001173789228_aaf67b77cf69a4c69a7bbf6d39b32f5dd">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.959999999999999%" headers="mcps1.3.3.2.2.6.1.5 "><p id="mrs_01_1122__en-us_topic_0000001173789228_a44319654b8354a249517c22d9f1de5aa">None</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_01_1122__en-us_topic_0000001173789228_r61cbcd3cb7bf4ddb99d93c261427cfec"><td class="cellrowborder" valign="top" width="16.11%" headers="mcps1.3.3.2.2.6.1.1 "><p id="mrs_01_1122__en-us_topic_0000001173789228_a8a91c6acb59b4d0d9880fc8c5cc97a70">Absolute path</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.24%" headers="mcps1.3.3.2.2.6.1.2 "><p id="mrs_01_1122__en-us_topic_0000001173789228_a1d2028c4163141899957ee22246c6298">Indicates whether the file name used as the value of <span class="parmname" id="mrs_01_1122__en-us_topic_0000001173789228_p85956b9a777e424aa7ad15cf571e41ad"><b>Filename as field</b></span> contains an absolute path. Selecting the option button indicates that the file name contains an absolute path; deselecting the option button indicates that the file name does not contain a path.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="11.21%" headers="mcps1.3.3.2.2.6.1.3 "><p id="mrs_01_1122__en-us_topic_0000001173789228_a16c6214700564b6186d4fcbda96be221">boolean</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.48%" headers="mcps1.3.3.2.2.6.1.4 "><p id="mrs_01_1122__en-us_topic_0000001173789228_a1cf0dd64a35840d0a52fb60431ef42ca">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.959999999999999%" headers="mcps1.3.3.2.2.6.1.5 "><p id="mrs_01_1122__en-us_topic_0000001173789228_a146762ed9a6d480a8e4c8125a5e37be7">Deselect</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_01_1122__en-us_topic_0000001173789228_rd69f05eb75134498b3da9eee41ffd7d8"><td class="cellrowborder" valign="top" width="16.11%" headers="mcps1.3.3.2.2.6.1.1 "><p id="mrs_01_1122__en-us_topic_0000001173789228_a270047de9eba440197aaef4fda7bab1e">Validate input field</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.24%" headers="mcps1.3.3.2.2.6.1.2 "><p id="mrs_01_1122__en-us_topic_0000001173789228_af04abdeaecd44a888c71e73f774d95db">Checks whether the input field matches the value type. If the value is <span class="parmvalue" id="mrs_01_1122__en-us_topic_0000001173789228_pfa75cb2da3d9447faea83e5f09ce596f"><b>NO</b></span>, no check is performed. If the value is <span class="parmvalue" id="mrs_01_1122__en-us_topic_0000001173789228_p112a14d6d39a4cc999f7601c6c507583"><b>YES</b></span>, whether the input field matches the value type is checked. If the input fields do not match the value type, the line is skipped.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="11.21%" headers="mcps1.3.3.2.2.6.1.3 "><p id="mrs_01_1122__en-us_topic_0000001173789228_afcdb34e3128b43f688a63c4fb7b3656c">enum</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.48%" headers="mcps1.3.3.2.2.6.1.4 "><p id="mrs_01_1122__en-us_topic_0000001173789228_a179438c462fe4e688099c3572495da68">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.959999999999999%" headers="mcps1.3.3.2.2.6.1.5 "><p id="mrs_01_1122__en-us_topic_0000001173789228_aef2d117fe70844698b29c19bc9071a07">YES</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_01_1122__en-us_topic_0000001173789228_r8a8aeb484e534028b7ec7ef4832b6f9d"><td class="cellrowborder" valign="top" width="16.11%" headers="mcps1.3.3.2.2.6.1.1 "><p id="mrs_01_1122__en-us_topic_0000001173789228_a799355df023742cc8c817521b4f7873d">Input fields</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.24%" headers="mcps1.3.3.2.2.6.1.2 "><p id="mrs_01_1122__en-us_topic_0000001173789228_a44446ff6638b44fc824f03ccb478237b">Information about input fields:</p>
|
|
<ul id="mrs_01_1122__en-us_topic_0000001173789228_u2a1a65ecc63c42faa2dfe472d0a10d53"><li id="mrs_01_1122__en-us_topic_0000001173789228_l545b921f881a4260bec67763bc43ac7f"><span class="parmname" id="mrs_01_1122__en-us_topic_0000001173789228_p5e69743a8a5d4986a2395cbe9b0828a3"><b>position</b></span>: Position of the field after data lines in the source file are separated by delimiters. The position sequence starts from 1.</li><li id="mrs_01_1122__en-us_topic_0000001173789228_lf550a740a3ae4acd897a92ffb62226a0"><span class="parmname" id="mrs_01_1122__en-us_topic_0000001173789228_p296663f353494d3b9c4e6843eda1b0a4"><b>field name</b></span>: Field name.</li><li id="mrs_01_1122__en-us_topic_0000001173789228_lba49ddca9fdc451db59ace67f47476f5"><span class="parmname" id="mrs_01_1122__en-us_topic_0000001173789228_p5b614d979caa42db9075e7b6ab7d83b1"><b>type</b></span>: Field type.</li><li id="mrs_01_1122__en-us_topic_0000001173789228_l2576a097c9844c76860583e9eb448625"><span class="parmname" id="mrs_01_1122__en-us_topic_0000001173789228_p8de369dcd22a4139a3e674adf5356751"><b>date format</b></span>: If the field type is <span class="parmname" id="mrs_01_1122__en-us_topic_0000001173789228_pcfd06e7fe8da460f8b95405769c4e062"><b>DATE</b></span>, <span class="parmvalue" id="mrs_01_1122__en-us_topic_0000001173789228_p89b9724e3dfb41a389cbd75b2100b147"><b>TIME</b></span>, or <span class="parmvalue" id="mrs_01_1122__en-us_topic_0000001173789228_p02fa4991ebdf4d22a0b906fd60e4a203"><b>TIMESTAMP</b></span>, you must specify a time format. If the field type is set to other values, the time format is invalid. An example time format is <span class="filepath" id="mrs_01_1122__en-us_topic_0000001173789228_f9f4c1bff0dd344d98090aa7e1bd69fa8"><b>yyyyMMdd HH:mm:ss</b></span>.</li><li id="mrs_01_1122__en-us_topic_0000001173789228_lee01d4f024774accab6c684048ab9923"><span class="parmname" id="mrs_01_1122__en-us_topic_0000001173789228_p1baf353246614506a44eab64f14458c6"><b>length</b></span>: Field value length. If the actual field value is excessively long, the value is cut based on the configured length. When <span class="parmname" id="mrs_01_1122__en-us_topic_0000001173789228_p350fdbbda3a8406b8345322fb3ce04cb"><b>type</b></span> is set to <span class="parmvalue" id="mrs_01_1122__en-us_topic_0000001173789228_pf0fe8b1d12444445a867a132f7f2a8ed"><b>CHAR</b></span>, spaces are added to the field value for supplement if the actual field value length is less than the configured length. When <span class="parmname" id="mrs_01_1122__en-us_topic_0000001173789228_p58bf7d9141944d21a8c28f21164e6b90"><b>type</b></span> is set to <span class="parmvalue" id="mrs_01_1122__en-us_topic_0000001173789228_pfb4744ad0e90471faec7ba3db1e73c6c"><b>VARCHAR</b></span>, no space is added to the field value for supplement if the actual field value length is less than the configured length.</li></ul>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="11.21%" headers="mcps1.3.3.2.2.6.1.3 "><p id="mrs_01_1122__en-us_topic_0000001173789228_a0ec842f11b34423088bf1e819d5301f7">map</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.48%" headers="mcps1.3.3.2.2.6.1.4 "><p id="mrs_01_1122__en-us_topic_0000001173789228_a48453e796e2445d09f82d8173b7416bc">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.959999999999999%" headers="mcps1.3.3.2.2.6.1.5 "><p id="mrs_01_1122__en-us_topic_0000001173789228_ad728b1f8cf4e4e4a87abe0b8b3afaff8">None</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="mrs_01_1122__en-us_topic_0000001173789228_s04cf81747f854b368d386e998d2e06be"><h4 class="sectiontitle">Data Processing Rule</h4><ul id="mrs_01_1122__en-us_topic_0000001173789228_u5b243799288147b19e74da9b03d9ec3d"><li id="mrs_01_1122__en-us_topic_0000001173789228_lafa19d1fcf2542f2a94ccacec551c6b7">Each data line is separated into multiple fields by using delimiters and the fields are used by the subsequent conversion operator.</li><li id="mrs_01_1122__en-us_topic_0000001173789228_lec134f47ff5049dc96749d4e18247b2a">If the field value does not match the actual type, the data in the line will become dirty data.</li><li id="mrs_01_1122__en-us_topic_0000001173789228_l89c9061b8cfb48dbb1884f3bd1769a08">If the number of input field columns is equal to the number of field columns actually included in the original data, the data in the line will become dirty data.</li></ul>
|
|
</div>
|
|
<div class="section" id="mrs_01_1122__en-us_topic_0000001173789228_s30161180ce554d7c92886cb5011939d7"><h4 class="sectiontitle">Example</h4><p id="mrs_01_1122__en-us_topic_0000001173789228_a7ca36612bf8949cca86a0cd7ae0bb357">The following figure shows the source file.</p>
|
|
<p id="mrs_01_1122__en-us_topic_0000001173789228_ac1671f948d014e15922bc8b37b5360fe"><span><img id="mrs_01_1122__en-us_topic_0000001173789228_if403a6ac06cc46439987d142cf9b224f" src="en-us_image_0000001295740268.jpg"></span></p>
|
|
<p id="mrs_01_1122__en-us_topic_0000001173789228_a598af531fd2d4a378c4d5ef7f829ec24">Configure the <span class="parmname" id="mrs_01_1122__en-us_topic_0000001173789228_paf2a6cb660f844248d57a116dd0bd0e8"><b>CSV File Input</b></span> operator, set <span class="parmname" id="mrs_01_1122__en-us_topic_0000001173789228_p95397d83a0e2466fb2bec5e3e1f4931d"><b>Delimiter</b></span> to a comma (<span class="parmvalue" id="mrs_01_1122__en-us_topic_0000001173789228_p0021f4b6d4d948e2a72bdf4bf00bfb49"><b>,</b></span>), and generate fields A and B.</p>
|
|
<p id="mrs_01_1122__en-us_topic_0000001173789228_a86b430ac86e54b5e9a03b97641ad4c6c"><span><img id="mrs_01_1122__en-us_topic_0000001173789228_i0228af1fe82142adac25c6f7562acf11" src="en-us_image_0000001349139781.jpg"></span></p>
|
|
<p id="mrs_01_1122__en-us_topic_0000001173789228_a4b7d980552a8406ea5d9c4f5e58610b4">Fields A and B are generated, as shown in the following figure.</p>
|
|
<p id="mrs_01_1122__en-us_topic_0000001173789228_acf0c679a30bb45b8b394a6be73a6ecd6"><span><img id="mrs_01_1122__en-us_topic_0000001173789228_i8aaacb4aae53412ab0d4f69e607d0994" src="en-us_image_0000001295900228.jpg"></span></p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_1121.html">Input Operators</a></div>
|
|
</div>
|
|
</div>
|
|
|