<?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 How to maintain the moved file structure in NiFi FetchFile processor in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-maintain-the-moved-file-structure-in-NiFi-FetchFile/m-p/297356#M218660</link>
    <description>&lt;P&gt;I have few files as follows.&lt;/P&gt;&lt;P&gt;/source/abc.txt&lt;/P&gt;&lt;P&gt;/source/xyz.txt&lt;/P&gt;&lt;P&gt;/source/subdir/abc-sub.txt&lt;/P&gt;&lt;P&gt;/source/subdir/xyz-sub.txt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, all the files are copied to the output dir&lt;/P&gt;&lt;P&gt;/output/abc.txt&lt;/P&gt;&lt;P&gt;/output/xyz.txt&lt;/P&gt;&lt;P&gt;/output/abc-sub.txt&lt;/P&gt;&lt;P&gt;/output/xyz-sub.txt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to re-create/maintain the original file hierarchy, as follows;&lt;/P&gt;&lt;P&gt;/output/abc.txt&lt;/P&gt;&lt;P&gt;/output/xyz.txt&lt;/P&gt;&lt;P&gt;/output/subdir/abc-sub.txt&lt;/P&gt;&lt;P&gt;/output/subdir/xyz-sub.txt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jun 2020 10:35:55 GMT</pubDate>
    <dc:creator>JonnyL</dc:creator>
    <dc:date>2020-06-04T10:35:55Z</dc:date>
    <item>
      <title>How to maintain the moved file structure in NiFi FetchFile processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-maintain-the-moved-file-structure-in-NiFi-FetchFile/m-p/297356#M218660</link>
      <description>&lt;P&gt;I have few files as follows.&lt;/P&gt;&lt;P&gt;/source/abc.txt&lt;/P&gt;&lt;P&gt;/source/xyz.txt&lt;/P&gt;&lt;P&gt;/source/subdir/abc-sub.txt&lt;/P&gt;&lt;P&gt;/source/subdir/xyz-sub.txt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, all the files are copied to the output dir&lt;/P&gt;&lt;P&gt;/output/abc.txt&lt;/P&gt;&lt;P&gt;/output/xyz.txt&lt;/P&gt;&lt;P&gt;/output/abc-sub.txt&lt;/P&gt;&lt;P&gt;/output/xyz-sub.txt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to re-create/maintain the original file hierarchy, as follows;&lt;/P&gt;&lt;P&gt;/output/abc.txt&lt;/P&gt;&lt;P&gt;/output/xyz.txt&lt;/P&gt;&lt;P&gt;/output/subdir/abc-sub.txt&lt;/P&gt;&lt;P&gt;/output/subdir/xyz-sub.txt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2020 10:35:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-maintain-the-moved-file-structure-in-NiFi-FetchFile/m-p/297356#M218660</guid>
      <dc:creator>JonnyL</dc:creator>
      <dc:date>2020-06-04T10:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to maintain the moved file structure in NiFi FetchFile processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-maintain-the-moved-file-structure-in-NiFi-FetchFile/m-p/297373#M218666</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/78685"&gt;@JonnyL&lt;/a&gt;&amp;nbsp;after FetchFile each flowfile contains an attribute called ${path}. &amp;nbsp;Use this path when writing the files like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="PutFile Settings" style="width: 999px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/27887i8DF010C8AA2E37AF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2020-06-04 at 8.05.12 AM.png" alt="PutFile Settings" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;PutFile Settings&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Expected Output" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/27889i35F734E20B58A4DB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2020-06-04 at 8.08.22 AM.png" alt="Expected Output" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Expected Output&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can find my template for this test here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/steven-dfheinz/NiFi-Templates/blob/master/ListFile_FetchFile_PutFile_Demo.xml" target="_blank"&gt;https://github.com/steven-dfheinz/NiFi-Templates/blob/master/ListFile_FetchFile_PutFile_Demo.xml&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this answer resolves your issue or allows you to move forward, please choose to ACCEPT this solution and close this topic. If you have further dialogue on this topic please comment here or feel free to private message me. If you have new questions related to your Use Case please create separate topic and feel free to tag me in your post. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Steven&amp;nbsp;@ DFHZ&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2020 12:10:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-maintain-the-moved-file-structure-in-NiFi-FetchFile/m-p/297373#M218666</guid>
      <dc:creator>stevenmatison</dc:creator>
      <dc:date>2020-06-04T12:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to maintain the moved file structure in NiFi FetchFile processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-maintain-the-moved-file-structure-in-NiFi-FetchFile/m-p/297387#M218675</link>
      <description>&lt;P&gt;I ran my flow and found the path attribute, but it is set to simply / so that is not a 100% solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My flow is based on the reply to this question&amp;nbsp;&lt;A href="https://community.cloudera.com/t5/Support-Questions/Hi-Everyone-Is-there-any-processor-available-in-NiFi-to-read/m-p/219993?childToView=186970#answer-186970" target="_blank"&gt;https://community.cloudera.com/t5/Support-Questions/Hi-Everyone-Is-there-any-processor-available-in-NiFi-to-read/m-p/219993?childToView=186970#answer-186970&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, subtly, I have a GetFile watching for a file dropped into a directory that kicks off the flow!. The name of the file is the same as that of the directory with .done, so I strip off the .done and then pass the directory name as the flowfile and continue as answer-186970...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2020 14:16:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-maintain-the-moved-file-structure-in-NiFi-FetchFile/m-p/297387#M218675</guid>
      <dc:creator>JonnyL</dc:creator>
      <dc:date>2020-06-04T14:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to maintain the moved file structure in NiFi FetchFile processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-maintain-the-moved-file-structure-in-NiFi-FetchFile/m-p/297463#M218706</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/78685"&gt;@JonnyL&lt;/a&gt;&amp;nbsp; &amp;nbsp;The sample above provided exact output you requested. &amp;nbsp;Please inspect the template and inspect FlowFiles for root files and subdirectories files. &amp;nbsp; The path attribute, when the file comes from a subfolder is the subfolder ("/subdir") as needed. &amp;nbsp;For any files in root folder, then path is "./". &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Additionally the absolute path attribute is also there for all the files. &amp;nbsp;This attribute can be acted against too with deeper expression language, but I found path was easier.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2020 12:20:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-maintain-the-moved-file-structure-in-NiFi-FetchFile/m-p/297463#M218706</guid>
      <dc:creator>stevenmatison</dc:creator>
      <dc:date>2020-06-05T12:20:33Z</dc:date>
    </item>
  </channel>
</rss>

