<?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: NIFI - save file with date of file tittle in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-save-file-with-date-of-file-tittle/m-p/195023#M83846</link>
    <description>&lt;P&gt;Thank you very much I have to solve it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Sep 2018 18:23:18 GMT</pubDate>
    <dc:creator>jricogar</dc:creator>
    <dc:date>2018-09-27T18:23:18Z</dc:date>
    <item>
      <title>NIFI - save file with date of file tittle</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-save-file-with-date-of-file-tittle/m-p/195021#M83844</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a dataflow that give a files to ftp and save thats files into HDFS. The problem is the name of folders in HDFS is the date that the name file contains, for example:&lt;/P&gt;&lt;P&gt;test_&lt;STRONG&gt;20180926&lt;/STRONG&gt;.txt --&amp;gt; HDFS: &lt;STRONG&gt;/2018/09/26/&lt;/STRONG&gt;test_20180926.txt&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 04:45:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-save-file-with-date-of-file-tittle/m-p/195021#M83844</guid>
      <dc:creator>jricogar</dc:creator>
      <dc:date>2018-09-27T04:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: NIFI - save file with date of file tittle</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-save-file-with-date-of-file-tittle/m-p/195022#M83845</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;The FTP processors (listFTP or GetFTP) create an attribute (filename) on the created NiFi FlowFiles they output.  You can use the UpdateAttribute processor and NiFi Expression Language to manipulate the filename string to create a new FlowFile attribute with the desired path you want to they use in your PutHDFS processor.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="91564-screen-shot-2018-09-26-at-55931-pm.png" style="width: 916px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/18046i7D69CB392A27434C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="91564-screen-shot-2018-09-26-at-55931-pm.png" alt="91564-screen-shot-2018-09-26-at-55931-pm.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here you can see the configuration of the UpdateAttribute processor.  I have added a "new property" and named it "hdfsPath".  This property name will become the name of my new FlowFileAttribute.  I then created a NiFi Expression Language statement that extracts the date string from the existing "filename" attribute and converts it in to a path format using:&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;${filename:substringAfterLast('_'):substringBeforeLast('.'):toDate('yyyyMMdd'):format('/yyy/MM/dd')}&lt;/PRE&gt;&lt;P&gt;The result of above is assigned to "hdfsPath".&lt;/P&gt;&lt;P&gt;I can then use that new attribute as my path in the PutHDFS processor for example:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="91565-screen-shot-2018-09-26-at-60549-pm.png" style="width: 504px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/18047i772CCD498845AEC6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="91565-screen-shot-2018-09-26-at-60549-pm.png" alt="91565-screen-shot-2018-09-26-at-60549-pm.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;If you found this answer addressed your question, please take a moment to login in and click the "ACCEPT" link.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 06:42:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-save-file-with-date-of-file-tittle/m-p/195022#M83845</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2019-08-18T06:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: NIFI - save file with date of file tittle</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-save-file-with-date-of-file-tittle/m-p/195023#M83846</link>
      <description>&lt;P&gt;Thank you very much I have to solve it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 18:23:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-save-file-with-date-of-file-tittle/m-p/195023#M83846</guid>
      <dc:creator>jricogar</dc:creator>
      <dc:date>2018-09-27T18:23:18Z</dc:date>
    </item>
  </channel>
</rss>

