<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question NIFI - link 3 columns in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-link-3-columns/m-p/195449#M83903</link>
    <description>&lt;P&gt;Hello, I need link 3 column in all rows of the file, for example:&lt;/P&gt;&lt;P&gt;column1;column2;column3;&lt;STRONG&gt;2018;09;27&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;column1_1;column2_1;column3_1;&lt;STRONG&gt;2018;09;27&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;column1_2;column2_2;column3_2;&lt;STRONG&gt;2018;09;27&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;the output file must contains only 4 columns:&lt;/P&gt;&lt;P&gt;column1;column2;column3;&lt;STRONG&gt;20180927&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;column1_1;column2_1;column3_1;&lt;STRONG&gt;20180927&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;column1_2;column2_2;column3_2;&lt;STRONG&gt;20180927&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The input file is .txt and the output file should be .txt&lt;/P&gt;&lt;P&gt;Thaks!!&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Sep 2018 10:15:45 GMT</pubDate>
    <dc:creator>jricogar</dc:creator>
    <dc:date>2018-09-28T10:15:45Z</dc:date>
    <item>
      <title>NIFI - link 3 columns</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-link-3-columns/m-p/195449#M83903</link>
      <description>&lt;P&gt;Hello, I need link 3 column in all rows of the file, for example:&lt;/P&gt;&lt;P&gt;column1;column2;column3;&lt;STRONG&gt;2018;09;27&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;column1_1;column2_1;column3_1;&lt;STRONG&gt;2018;09;27&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;column1_2;column2_2;column3_2;&lt;STRONG&gt;2018;09;27&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;the output file must contains only 4 columns:&lt;/P&gt;&lt;P&gt;column1;column2;column3;&lt;STRONG&gt;20180927&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;column1_1;column2_1;column3_1;&lt;STRONG&gt;20180927&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;column1_2;column2_2;column3_2;&lt;STRONG&gt;20180927&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The input file is .txt and the output file should be .txt&lt;/P&gt;&lt;P&gt;Thaks!!&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Sep 2018 10:15:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-link-3-columns/m-p/195449#M83903</guid>
      <dc:creator>jricogar</dc:creator>
      <dc:date>2018-09-28T10:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: NIFI - link 3 columns</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-link-3-columns/m-p/195450#M83904</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/97215/jricogar.html" nodeid="97215" target="_blank"&gt;@Pepelu Rico&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can achieve this by using &lt;STRONG&gt;ReplaceText processor&lt;/STRONG&gt; (or) &lt;STRONG&gt;UpdateRecord processor&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;&lt;EM&gt;Method1:Using UpdateRecord processor:&lt;/EM&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If you are working on larger number of rows then use UpdateRecord processor and define CSV Reader controller service with ; as value seperator.&lt;/P&gt;&lt;P&gt;Define CSV writer controller service add new property in the Processor as&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/link3column&lt;/STRONG&gt; as &lt;/P&gt;&lt;PRE&gt;concat(/col_4,/col5,/col6)&lt;/PRE&gt;&lt;P&gt;Refer to &lt;A href="https://community.hortonworks.com/articles/189642/update-the-contents-of-flowfile-by-using-updaterec.html" target="_blank" rel="nofollow noopener noreferrer"&gt;this&lt;/A&gt; link for configure/Usage of UpdateRecord processor.&lt;/P&gt;&lt;P&gt;&lt;B&gt;&lt;U&gt;&lt;EM&gt;Method2:&lt;/EM&gt;&lt;/U&gt;&lt;/B&gt;&lt;STRONG&gt;&lt;U&gt;&lt;EM&gt;Using ReplaceText processor:&lt;/EM&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Use this method if you are dealing with less number of records&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="92591-screen-shot-2018-09-27-at-112953-pm.png" style="width: 1370px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/18014iAC656277BC293AF0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="92591-screen-shot-2018-09-27-at-112953-pm.png" alt="92591-screen-shot-2018-09-27-at-112953-pm.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Search Value
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;^((?:[^;]+;\s*){3})(.*)&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Replacement Value
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;$1${'$2':replace(";","")}&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Character Set
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;UTF-8&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Maximum Buffer Size
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;1 MB //change this value according to your flowfile size&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Replacement Strategy
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Regex Replace&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Evaluation Mode
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Line-by-Line&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;In this method we are using regex to match &lt;STRONG&gt;until third ; to first capture group($1)&lt;/STRONG&gt; and &lt;STRONG&gt;rest of the data into $2 &lt;/STRONG&gt;capture group.&lt;/P&gt;&lt;P&gt;Making use of &lt;STRONG&gt;NiFi expression language&lt;/STRONG&gt; we are replacing "&lt;STRONG&gt;;" in $2 capture group with ""&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;OutputFlowfile:&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;column1;column2;column3;20180927column1_1;column2_1;column3_1;20180927column1_2;column2_2;column3_2;20180927&lt;/PRE&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;If the Answer helped to resolve your issue, &lt;STRONG&gt;Click on Accept button below to accept the answer,&lt;/STRONG&gt; That would be great help to Community users to find solution quickly for these kind of issues.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 06:38:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-link-3-columns/m-p/195450#M83904</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T06:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: NIFI - link 3 columns</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-link-3-columns/m-p/195451#M83905</link>
      <description>&lt;P&gt;Thanks &lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929"&gt;@Shu&lt;/A&gt; , It has been very helpful!!&lt;/P&gt;</description>
      <pubDate>Mon, 01 Oct 2018 15:19:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-link-3-columns/m-p/195451#M83905</guid>
      <dc:creator>jricogar</dc:creator>
      <dc:date>2018-10-01T15:19:01Z</dc:date>
    </item>
  </channel>
</rss>

