<?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 Re: Deleting specific lines of an csv file using Apache NIFI in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Deleting-specific-lines-of-an-csv-file-using-Apache-NIFI/m-p/196802#M71341</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/48241/onestoneh.html" nodeid="48241" target="_blank"&gt;@Salda Murrah&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;if you want to filter out &lt;STRONG&gt;2016 and 2017 records&lt;/STRONG&gt; then in route on content processor &lt;STRONG&gt;change the below properties &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Routeoncontent with Contains as Matching Strategy:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;Keep Matching Strategy as Contains &lt;/PRE&gt;
&lt;PRE&gt;Route Strategy as Route to each matching Property Name&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;add new properties &lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;1.2016 as 2016 //check for content if it contains 2016 then route to this relation
2.2017 as 2017 //check for content if it contains 2017 then route to this relation&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Routeoncontent configs:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="42591-routeoncontent.png" style="width: 584px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17885i5DEECA569952F255/image-size/medium?v=v2&amp;amp;px=400" role="button" title="42591-routeoncontent.png" alt="42591-routeoncontent.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;(or)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Routeoncontent with RegularExpression as Matching Strategy:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If you want to check the contents of flow file with regular expressions then &lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;Keep Matching Strategy as Matches Regular Expression&lt;/PRE&gt;
&lt;PRE&gt;Route Strategy as Route to each matching Property Name&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;add new properties&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;1.2016 as ^.*;.*2016.*;.*$  //check for content if it contains 2016 then route to this relation
2. 2017 as ^.*;.*2017.*;.*$ //check for content if it contains 2017 then route to this relation&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Routeoncontent with RegularExpression Config:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="42592-roc-regex.png" style="width: 654px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17886iF629195E4BB34D7B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="42592-roc-regex.png" alt="42592-roc-regex.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Flow:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;ListFile --&amp;gt; FetchFile --&amp;gt; SplitText //split into 1 line --&amp;gt; RouteonContent //you can use either Contains (or) matches regular expression As Matching Strategies --&amp;gt; .... --&amp;gt;PutCassandraQL&lt;/PRE&gt;</description>
    <pubDate>Sun, 18 Aug 2019 06:23:20 GMT</pubDate>
    <dc:creator>Shu_ashu</dc:creator>
    <dc:date>2019-08-18T06:23:20Z</dc:date>
    <item>
      <title>Deleting specific lines of an csv file using Apache NIFI</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Deleting-specific-lines-of-an-csv-file-using-Apache-NIFI/m-p/196801#M71340</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I ingested csv files using ListFile and FetchFile processors. &lt;/P&gt;&lt;P&gt;Those files contain dates of 2016 in it which should all be deleted before saving it in cassandra.&lt;/P&gt;&lt;P&gt;The table looks like this: &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="42590-bildschirmfoto-vom-2017-11-14-142103.png" style="width: 1232px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17887iED5B1486E7B21634/image-size/medium?v=v2&amp;amp;px=400" role="button" title="42590-bildschirmfoto-vom-2017-11-14-142103.png" alt="42590-bildschirmfoto-vom-2017-11-14-142103.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="42588-bildschirmfoto-vom-2017-11-14-141416.png" style="width: 515px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17888iB4D1F0B7C8FAEB82/image-size/medium?v=v2&amp;amp;px=400" role="button" title="42588-bildschirmfoto-vom-2017-11-14-141416.png" alt="42588-bildschirmfoto-vom-2017-11-14-141416.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/42584-bildschirmfoto-vom-2017-11-14-141416.png" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="42584-bildschirmfoto-vom-2017-11-14-141416.png" style="width: 515px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17889iFBC68CB6D1410ACA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="42584-bildschirmfoto-vom-2017-11-14-141416.png" alt="42584-bildschirmfoto-vom-2017-11-14-141416.png" /&gt;&lt;/span&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I got a problem with extracting/deleting these lines:&lt;/P&gt;&lt;P&gt;It looks like this: &lt;A href="https://community.cloudera.com/legacyfs/online/attachments/42586-bildschirmfoto-vom-2017-11-14-141356.png" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="42586-bildschirmfoto-vom-2017-11-14-141356.png" style="width: 780px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17890iD1BE4DEF75EF1F97/image-size/medium?v=v2&amp;amp;px=400" role="button" title="42586-bildschirmfoto-vom-2017-11-14-141356.png" alt="42586-bildschirmfoto-vom-2017-11-14-141356.png" /&gt;&lt;/span&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="42589-bildschirmfoto-vom-2017-11-14-141356.png" style="width: 810px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17891iA5AF3ABB6E35F969/image-size/medium?v=v2&amp;amp;px=400" role="button" title="42589-bildschirmfoto-vom-2017-11-14-141356.png" alt="42589-bildschirmfoto-vom-2017-11-14-141356.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;with following properties in RouteText (testing it out with different options)&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/42587-bildschirmfoto-vom-2017-11-14-142103.png" target="_blank"&gt;&lt;BR /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/42587-bildschirmfoto-vom-2017-11-14-142103.png" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="42587-bildschirmfoto-vom-2017-11-14-142103.png" style="width: 1232px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17892iDF6D5410A1CEA7F1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="42587-bildschirmfoto-vom-2017-11-14-142103.png" alt="42587-bildschirmfoto-vom-2017-11-14-142103.png" /&gt;&lt;/span&gt;&lt;/A&gt;It is still sending all lines to the next processor. (or none)&lt;/P&gt;&lt;P&gt;Do you have an idea of an solution?&lt;/P&gt;&lt;P&gt;Thanks in advance! &lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 06:23:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Deleting-specific-lines-of-an-csv-file-using-Apache-NIFI/m-p/196801#M71340</guid>
      <dc:creator>onestoneh</dc:creator>
      <dc:date>2019-08-18T06:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting specific lines of an csv file using Apache NIFI</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Deleting-specific-lines-of-an-csv-file-using-Apache-NIFI/m-p/196802#M71341</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/48241/onestoneh.html" nodeid="48241" target="_blank"&gt;@Salda Murrah&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;if you want to filter out &lt;STRONG&gt;2016 and 2017 records&lt;/STRONG&gt; then in route on content processor &lt;STRONG&gt;change the below properties &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Routeoncontent with Contains as Matching Strategy:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;Keep Matching Strategy as Contains &lt;/PRE&gt;
&lt;PRE&gt;Route Strategy as Route to each matching Property Name&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;add new properties &lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;1.2016 as 2016 //check for content if it contains 2016 then route to this relation
2.2017 as 2017 //check for content if it contains 2017 then route to this relation&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Routeoncontent configs:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="42591-routeoncontent.png" style="width: 584px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17885i5DEECA569952F255/image-size/medium?v=v2&amp;amp;px=400" role="button" title="42591-routeoncontent.png" alt="42591-routeoncontent.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;(or)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Routeoncontent with RegularExpression as Matching Strategy:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If you want to check the contents of flow file with regular expressions then &lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;Keep Matching Strategy as Matches Regular Expression&lt;/PRE&gt;
&lt;PRE&gt;Route Strategy as Route to each matching Property Name&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;add new properties&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;1.2016 as ^.*;.*2016.*;.*$  //check for content if it contains 2016 then route to this relation
2. 2017 as ^.*;.*2017.*;.*$ //check for content if it contains 2017 then route to this relation&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Routeoncontent with RegularExpression Config:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="42592-roc-regex.png" style="width: 654px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17886iF629195E4BB34D7B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="42592-roc-regex.png" alt="42592-roc-regex.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Flow:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;ListFile --&amp;gt; FetchFile --&amp;gt; SplitText //split into 1 line --&amp;gt; RouteonContent //you can use either Contains (or) matches regular expression As Matching Strategies --&amp;gt; .... --&amp;gt;PutCassandraQL&lt;/PRE&gt;</description>
      <pubDate>Sun, 18 Aug 2019 06:23:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Deleting-specific-lines-of-an-csv-file-using-Apache-NIFI/m-p/196802#M71341</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T06:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting specific lines of an csv file using Apache NIFI</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Deleting-specific-lines-of-an-csv-file-using-Apache-NIFI/m-p/196803#M71342</link>
      <description>&lt;P&gt;Thank you very much! It worked very well for me!&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 23:22:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Deleting-specific-lines-of-an-csv-file-using-Apache-NIFI/m-p/196803#M71342</guid>
      <dc:creator>onestoneh</dc:creator>
      <dc:date>2017-11-15T23:22:53Z</dc:date>
    </item>
  </channel>
</rss>

