<?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>topic Re: how to validate the input file in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/how-to-validate-the-input-file/m-p/2352697#M119045</link>
    <description>Thanks for your reply.&lt;BR /&gt;Then, is there a way to read the last line (or particular line) ? &lt;BR /&gt;Thanks !&lt;BR /&gt;James</description>
    <pubDate>Mon, 05 Aug 2013 02:44:20 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-08-05T02:44:20Z</dc:date>
    <item>
      <title>how to validate the input file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-validate-the-input-file/m-p/2352695#M119043</link>
      <description>Hi,
&lt;BR /&gt;Is there a way to validate the input file according to some conditions before the process ?
&lt;BR /&gt;For example, if the input file's record number in Footer (one column names records_total) is 100, but the actual input rows are 95. Then I will reject the file and log into the rejected table. Otherwise, I will go to normal process.
&lt;BR /&gt;My first though was tJava, but it is not that dorable. 
&lt;BR /&gt;Thanks !
&lt;BR /&gt;James</description>
      <pubDate>Sat, 03 Aug 2013 19:21:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-validate-the-input-file/m-p/2352695#M119043</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2013-08-03T19:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to validate the input file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-validate-the-input-file/m-p/2352696#M119044</link>
      <description>Not automatically. You'd have to read the last row and count the number of lines and compare them yourself.</description>
      <pubDate>Sun, 04 Aug 2013 23:57:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-validate-the-input-file/m-p/2352696#M119044</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2013-08-04T23:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to validate the input file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-validate-the-input-file/m-p/2352697#M119045</link>
      <description>Thanks for your reply.&lt;BR /&gt;Then, is there a way to read the last line (or particular line) ? &lt;BR /&gt;Thanks !&lt;BR /&gt;James</description>
      <pubDate>Mon, 05 Aug 2013 02:44:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-validate-the-input-file/m-p/2352697#M119045</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-05T02:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to validate the input file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-validate-the-input-file/m-p/2352698#M119046</link>
      <description>To read a particular line, you would set the header to be the number of rows before and the limit to 1.
&lt;BR /&gt;Reading the last line is not so easy. I think you would have to count the rows in the file and use that (minus 1) as a variable for the header of your input component.</description>
      <pubDate>Mon, 05 Aug 2013 13:28:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-validate-the-input-file/m-p/2352698#M119046</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2013-08-05T13:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to validate the input file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-validate-the-input-file/m-p/2352699#M119047</link>
      <description>Thank you for the reply. 
&lt;BR /&gt;I am think below process,
&lt;BR /&gt;tFileList 
&lt;BR /&gt;--&amp;gt; tFileInputPositional { if I set the header to limit = 1, I only get one record, but if file is valid, I will process all records} --&amp;gt; tJava{1. how to get the previous line as method input parameter ?, 2. how to output the method result of "if... else if ...."} --&amp;gt; tmap {1. how to get the tJava "if ...else..." result here and map the previous input file } ---&amp;gt; table1, ---&amp;gt; reject records, ----&amp;gt; reject files
&lt;BR /&gt;Is it doable ? If yes, could you help to answer questions above?
&lt;BR /&gt;
&lt;BR /&gt;Thanks !
&lt;BR /&gt;James</description>
      <pubDate>Mon, 05 Aug 2013 18:49:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-validate-the-input-file/m-p/2352699#M119047</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2013-08-05T18:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to validate the input file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-validate-the-input-file/m-p/2352700#M119048</link>
      <description>Here is the picture for previous process. 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MEtu.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/150619iAACA3450BF56E104/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MEtu.png" alt="0683p000009MEtu.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Mon, 05 Aug 2013 19:33:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-validate-the-input-file/m-p/2352700#M119048</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-05T19:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to validate the input file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-validate-the-input-file/m-p/2352701#M119049</link>
      <description>Header and Limit are two different parameters. 
&lt;BR /&gt;Use tFileRowCount to count the number of rows in the file, then use the globalMap variable it creates in tFileInputPositional to read just the last line and pass it to tJavaRow. You can then have RunIf triggers from tJavaRow to your processing if the file passes validation or if the file fails validation. 
&lt;BR /&gt;tFileList -iterate-&amp;gt; tFileRowCount -iterate-&amp;gt; tFileInput -row-&amp;gt; tJavaRow -if-&amp;gt; tFileInput -row-&amp;gt; tMap -row-&amp;gt; ... (valid file) 
&lt;BR /&gt; (1 row) (full file) 
&lt;BR /&gt; -if-&amp;gt; tSendMail (or whatever for invalid file)</description>
      <pubDate>Tue, 06 Aug 2013 00:32:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-validate-the-input-file/m-p/2352701#M119049</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2013-08-06T00:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to validate the input file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-validate-the-input-file/m-p/2352702#M119050</link>
      <description>Thanks for your message. &lt;BR /&gt;But I have a detail question about "-if" for  tJavaRow -if-&amp;gt; tFileInput -row-&amp;gt;&lt;BR /&gt;In tJavaRow, I set a Boolean variable "valid", how can I access this varialbe's value in "if" condition ?&lt;BR /&gt;In old posts, you once mentioned the RUN IF can only access the global variable.  Do I need a tSetGlobalVar between tJavaRow -if-&amp;gt; tFileInput -row-&amp;gt; ?&lt;BR /&gt;James</description>
      <pubDate>Tue, 06 Aug 2013 15:12:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-validate-the-input-file/m-p/2352702#M119050</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-06T15:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to validate the input file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-validate-the-input-file/m-p/2352703#M119051</link>
      <description>OK, I got it. &lt;BR /&gt;I can set the global variable in jJavaRow.&lt;BR /&gt;thanks !&lt;BR /&gt;James</description>
      <pubDate>Tue, 06 Aug 2013 15:27:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-validate-the-input-file/m-p/2352703#M119051</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-06T15:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to validate the input file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-validate-the-input-file/m-p/2352704#M119052</link>
      <description>You don't actually need to set a global variable in tJavaRow and reference that in the RunIf; you can just put the same boolean expression you're using in tJavaRow directly in the RunIf (although you have to use the real row names instead of input_row).</description>
      <pubDate>Tue, 06 Aug 2013 23:51:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-validate-the-input-file/m-p/2352704#M119052</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2013-08-06T23:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to validate the input file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-validate-the-input-file/m-p/2352705#M119053</link>
      <description>Yes, it works better. Thanks a lot !&lt;BR /&gt;James</description>
      <pubDate>Wed, 07 Aug 2013 13:26:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-validate-the-input-file/m-p/2352705#M119053</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-07T13:26:15Z</dc:date>
    </item>
  </channel>
</rss>

