<?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: Ignore first line of a file and process second line onwards in NiFi in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Ignore-first-line-of-a-file-and-process-second-line-onwards/m-p/393249#M248396</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/114561"&gt;@AlokKumar&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The more detail you provide the better response you will get.&lt;BR /&gt;In this case, more detail around the content/format of the source file (samples are great) and how it is being or will be processed downstream.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;A NiFi FlowFile is what is passed from one processor component to the next.&amp;nbsp; There is no direct relationship between what processing was done in one processor versus another.&amp;nbsp; Each Processor will read the FlowFile (consists of FlowFile Attributes/metadata and FlowFile content) and execute its processor code against the FlowFile and output a FlowFile(s) to one or more outbound relationships.&amp;nbsp; So processing against the content of A FlowFile becomes the responsibility of each processor separately.&amp;nbsp; &amp;nbsp;So the questions asked correlate to the answer you'll get.&lt;BR /&gt;&lt;BR /&gt;With what you shared, I can only suggest that you remove the first line from the content of the FlowFile so that downstream processor will only have line 2 to process against.&amp;nbsp;&lt;BR /&gt;This can be accomplished easily with a &lt;A href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.27.0/org.apache.nifi.processors.standard.ReplaceText/index.html" target="_blank"&gt;ReplaceText&lt;/A&gt; processor.&amp;nbsp; Simply configure it for&amp;nbsp; "Evaluation Mode" = "line-by-line",&amp;nbsp;"line-by-line Evaluation Mode" = "First-Line", and in "Replacement Value" property "Set empty string" check box.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MattWho_0-1725912158940.png" style="width: 698px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/41719iBB5BD25777011496/image-dimensions/698x464?v=v2" width="698" height="464" role="button" title="MattWho_0-1725912158940.png" alt="MattWho_0-1725912158940.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The output FlowFile' content, which is sent to the success relationship, will have everything except its first line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;Do you need to preserve line 1?&lt;BR /&gt;If so, maybe use &lt;A href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.27.0/org.apache.nifi.processors.standard.ExtractText/index.html" target="_blank"&gt;ExtractText&lt;/A&gt; to extract line 1 to a FlowFile attribute you can then use after processing to add back to Content again using ReplaceText.&lt;/P&gt;&lt;P&gt;Please help our community thrive. If you found&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;any&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Accept as Solution&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;" on&amp;nbsp;&lt;STRONG&gt;one or more&lt;/STRONG&gt;&amp;nbsp;of them that helped.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;BR /&gt;Matt&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Sep 2024 20:07:20 GMT</pubDate>
    <dc:creator>MattWho</dc:creator>
    <dc:date>2024-09-09T20:07:20Z</dc:date>
    <item>
      <title>Ignore first line of a file and process second line onwards in NiFi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Ignore-first-line-of-a-file-and-process-second-line-onwards/m-p/392711#M248217</link>
      <description>&lt;P&gt;Say I have a file having 100 records. In this file I want to ignore the first line as it's data I do not want to process (It contains some info like file name, date and number of records). I want to process from second line. How to do that?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 15:39:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Ignore-first-line-of-a-file-and-process-second-line-onwards/m-p/392711#M248217</guid>
      <dc:creator>AlokKumar</dc:creator>
      <dc:date>2024-08-28T15:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore first line of a file and process second line onwards in NiFi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Ignore-first-line-of-a-file-and-process-second-line-onwards/m-p/393249#M248396</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/114561"&gt;@AlokKumar&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The more detail you provide the better response you will get.&lt;BR /&gt;In this case, more detail around the content/format of the source file (samples are great) and how it is being or will be processed downstream.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;A NiFi FlowFile is what is passed from one processor component to the next.&amp;nbsp; There is no direct relationship between what processing was done in one processor versus another.&amp;nbsp; Each Processor will read the FlowFile (consists of FlowFile Attributes/metadata and FlowFile content) and execute its processor code against the FlowFile and output a FlowFile(s) to one or more outbound relationships.&amp;nbsp; So processing against the content of A FlowFile becomes the responsibility of each processor separately.&amp;nbsp; &amp;nbsp;So the questions asked correlate to the answer you'll get.&lt;BR /&gt;&lt;BR /&gt;With what you shared, I can only suggest that you remove the first line from the content of the FlowFile so that downstream processor will only have line 2 to process against.&amp;nbsp;&lt;BR /&gt;This can be accomplished easily with a &lt;A href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.27.0/org.apache.nifi.processors.standard.ReplaceText/index.html" target="_blank"&gt;ReplaceText&lt;/A&gt; processor.&amp;nbsp; Simply configure it for&amp;nbsp; "Evaluation Mode" = "line-by-line",&amp;nbsp;"line-by-line Evaluation Mode" = "First-Line", and in "Replacement Value" property "Set empty string" check box.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MattWho_0-1725912158940.png" style="width: 698px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/41719iBB5BD25777011496/image-dimensions/698x464?v=v2" width="698" height="464" role="button" title="MattWho_0-1725912158940.png" alt="MattWho_0-1725912158940.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The output FlowFile' content, which is sent to the success relationship, will have everything except its first line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;Do you need to preserve line 1?&lt;BR /&gt;If so, maybe use &lt;A href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.27.0/org.apache.nifi.processors.standard.ExtractText/index.html" target="_blank"&gt;ExtractText&lt;/A&gt; to extract line 1 to a FlowFile attribute you can then use after processing to add back to Content again using ReplaceText.&lt;/P&gt;&lt;P&gt;Please help our community thrive. If you found&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;any&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Accept as Solution&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;" on&amp;nbsp;&lt;STRONG&gt;one or more&lt;/STRONG&gt;&amp;nbsp;of them that helped.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;BR /&gt;Matt&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 20:07:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Ignore-first-line-of-a-file-and-process-second-line-onwards/m-p/393249#M248396</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2024-09-09T20:07:20Z</dc:date>
    </item>
  </channel>
</rss>

