<?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 Handle date column with spaces in nifi in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Handle-date-column-with-spaces-in-nifi/m-p/319940#M228047</link>
    <description>&lt;P&gt;I am trying to&amp;nbsp; format the date field which contains spaces in replace text processor from a csv file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Got the error as it is unable to parse the date column which is spaces for first record. Please let me know how to handle this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error message: Replace text failed to process session due to Cannot parse attribute value as a date; date format ddMMyyyy; attribute value:&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Input csv:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1,&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , 123&lt;/P&gt;&lt;P&gt;2,02091997,234&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Search value : (.{1}),(.{8}), (.{3})&amp;nbsp;&lt;/P&gt;&lt;P&gt;Replacement value : $1, ${'$2':toDate("ddMMyyyy") :format("yyyy-MM-dd HH:mm:ss.SSS") }, $3&lt;/P&gt;&lt;P&gt;Replacement strategy : Regex Replace&lt;/P&gt;&lt;P&gt;Evaluation mode : Entire Text&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Jul 2021 12:32:57 GMT</pubDate>
    <dc:creator>Chakkara</dc:creator>
    <dc:date>2021-07-06T12:32:57Z</dc:date>
    <item>
      <title>Handle date column with spaces in nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Handle-date-column-with-spaces-in-nifi/m-p/319940#M228047</link>
      <description>&lt;P&gt;I am trying to&amp;nbsp; format the date field which contains spaces in replace text processor from a csv file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Got the error as it is unable to parse the date column which is spaces for first record. Please let me know how to handle this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error message: Replace text failed to process session due to Cannot parse attribute value as a date; date format ddMMyyyy; attribute value:&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Input csv:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1,&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , 123&lt;/P&gt;&lt;P&gt;2,02091997,234&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Search value : (.{1}),(.{8}), (.{3})&amp;nbsp;&lt;/P&gt;&lt;P&gt;Replacement value : $1, ${'$2':toDate("ddMMyyyy") :format("yyyy-MM-dd HH:mm:ss.SSS") }, $3&lt;/P&gt;&lt;P&gt;Replacement strategy : Regex Replace&lt;/P&gt;&lt;P&gt;Evaluation mode : Entire Text&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jul 2021 12:32:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Handle-date-column-with-spaces-in-nifi/m-p/319940#M228047</guid>
      <dc:creator>Chakkara</dc:creator>
      <dc:date>2021-07-06T12:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Handle date column with spaces in nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Handle-date-column-with-spaces-in-nifi/m-p/319970#M228066</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/88760"&gt;@Chakkara&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What would you like the parser to do when it encounters an invalid date value? If this is a recurring problem, where multiple lines in your file have the same number of spaces to indicate missing date, then you can use&amp;nbsp;&lt;EM&gt;ifElse&amp;nbsp;&lt;/EM&gt;in your replacement value command (&lt;A href="https://stackoverflow.com/questions/66743407/convert-dates-in-apache-nifi" target="_self"&gt;something like this&lt;/A&gt;).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jul 2021 05:20:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Handle-date-column-with-spaces-in-nifi/m-p/319970#M228066</guid>
      <dc:creator>aakulov</dc:creator>
      <dc:date>2021-07-07T05:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Handle date column with spaces in nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Handle-date-column-with-spaces-in-nifi/m-p/319980#M228072</link>
      <description>&lt;P&gt;Thanks for the response and it works!!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jul 2021 08:15:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Handle-date-column-with-spaces-in-nifi/m-p/319980#M228072</guid>
      <dc:creator>Chakkara</dc:creator>
      <dc:date>2021-07-07T08:15:32Z</dc:date>
    </item>
  </channel>
</rss>

