<?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: Filename validation in talend in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Filename-validation-in-talend/m-p/2250532#M34745</link>
    <description>&lt;P&gt;Do You need process only files, which equal to already knowing pattern? or You need check filename not include nothing other than pattern?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;example of filename pattern:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;TalendDate.getDate("YYYYMMDD_HHmmss")+"_"+((String)globalMap.get("value1"))+"_"+((String)globalMap.get("value2"))+".txt"
TalendDate.getDate("YYYYMMDD_HHmmss")+"_"+((String)globalMap.get("value1"))+"_"+((String)globalMap.get("value2"))+"META.txt"&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but this pattern mean - You must know file name up to seconds&lt;/P&gt;
&lt;PRE&gt;TalendDate.getDate("YYYYMMDD_")+"*_"+((String)globalMap.get("value1"))+"_"+((String)globalMap.get("value2"))+".txt"
TalendDate.getDate("YYYYMMDD_")+"*_"+((String)globalMap.get("value1"))+"_"+((String)globalMap.get("value2"))+"META.txt"&lt;/PRE&gt;
&lt;P&gt;this pattern&amp;nbsp;in chain:&lt;/P&gt;
&lt;P&gt;tFileList -&amp;gt;(Iterate) -&amp;gt; (Your Steps)&lt;/P&gt;
&lt;P&gt;process all files from today&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and etc&lt;/P&gt;</description>
    <pubDate>Thu, 04 May 2017 22:38:38 GMT</pubDate>
    <dc:creator>vapukov</dc:creator>
    <dc:date>2017-05-04T22:38:38Z</dc:date>
    <item>
      <title>Filename validation in talend</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Filename-validation-in-talend/m-p/2250531#M34744</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I need to validate filenames that are being processed. For e.g. requirement is file name should be&lt;/P&gt; 
&lt;P&gt;Main file - YYYYMMDD_HHMMSS_Field1_Field2.txt&lt;BR /&gt;Meta file - YYYYMMDD_HHMMSS&lt;SPAN&gt;_Field1&lt;/SPAN&gt;&lt;SPAN&gt;_&lt;/SPAN&gt;&lt;SPAN&gt;Field2&lt;/SPAN&gt;_META.txt&lt;/P&gt; 
&lt;P&gt;Based on the file category i want two flows that will process main file and meta file and load into separate tables.&lt;/P&gt; 
&lt;P&gt;I am new to talend so detail explanation will be appreciated much&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks,&lt;/P&gt; 
&lt;P&gt;Pravin Sanadi&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2017 16:01:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Filename-validation-in-talend/m-p/2250531#M34744</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-04T16:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Filename validation in talend</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Filename-validation-in-talend/m-p/2250532#M34745</link>
      <description>&lt;P&gt;Do You need process only files, which equal to already knowing pattern? or You need check filename not include nothing other than pattern?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;example of filename pattern:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;TalendDate.getDate("YYYYMMDD_HHmmss")+"_"+((String)globalMap.get("value1"))+"_"+((String)globalMap.get("value2"))+".txt"
TalendDate.getDate("YYYYMMDD_HHmmss")+"_"+((String)globalMap.get("value1"))+"_"+((String)globalMap.get("value2"))+"META.txt"&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but this pattern mean - You must know file name up to seconds&lt;/P&gt;
&lt;PRE&gt;TalendDate.getDate("YYYYMMDD_")+"*_"+((String)globalMap.get("value1"))+"_"+((String)globalMap.get("value2"))+".txt"
TalendDate.getDate("YYYYMMDD_")+"*_"+((String)globalMap.get("value1"))+"_"+((String)globalMap.get("value2"))+"META.txt"&lt;/PRE&gt;
&lt;P&gt;this pattern&amp;nbsp;in chain:&lt;/P&gt;
&lt;P&gt;tFileList -&amp;gt;(Iterate) -&amp;gt; (Your Steps)&lt;/P&gt;
&lt;P&gt;process all files from today&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and etc&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2017 22:38:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Filename-validation-in-talend/m-p/2250532#M34745</guid>
      <dc:creator>vapukov</dc:creator>
      <dc:date>2017-05-04T22:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Filename validation in talend</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Filename-validation-in-talend/m-p/2250533#M34746</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for quick response. I need to validate all the files having the specified format. How do I route two flows one for main and one for meta file to load it in other tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Pravin&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 06:41:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Filename-validation-in-talend/m-p/2250533#M34746</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-05T06:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: Filename validation in talend</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Filename-validation-in-talend/m-p/2250534#M34747</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;I suggest you 2 options.&lt;/P&gt; 
&lt;P&gt;1st one, place a tFileList to get all the txt files, connect&amp;nbsp;&lt;SPAN&gt;tFileList to a tJava with an iterate flow.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;This tJava does nothing but opens 2 branch depending on the current filename.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Here I connect a tJava just to print the filename, preceding by "META &amp;gt; " if filename contains the string "_META.txt" (your usecase).&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Here is what's the job looks like:&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LtrG.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/135674iC3F00DB3712ABCBC/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LtrG.png" alt="0683p000009LtrG.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Look at the 2 "if" after tJava_4. The 1st one (on top) is for filenames with "_META.txt":&lt;/SPAN&gt;&lt;/P&gt; 
&lt;PRE&gt;((String)globalMap.get("tFileList_2_CURRENT_FILE")).contains("_META.txt")&lt;/PRE&gt; 
&lt;P&gt;&lt;SPAN&gt;and the 2nd for other cases:&lt;/SPAN&gt;&lt;/P&gt; 
&lt;PRE&gt;!((String)globalMap.get("tFileList_2_CURRENT_FILE")).contains("_META.txt")&lt;/PRE&gt; 
&lt;P&gt;(see the exclamation point at the begenning for negation).&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;You just have to play with filemask and order by option of the tFileList to drive how the files are processed.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The 2nd approach is to proceed with a group&amp;nbsp;of files first ("_META.txt" for example), then to go with the second group (non _META). In this case&amp;nbsp;you need 2 separate&amp;nbsp;tFileList with the corresponding filemask.&lt;/P&gt; 
&lt;P&gt;The 1st one to include all txt files with "_META.txt" in the name and the&amp;nbsp;2nd to exclude these files (see advanced settings for Exclude Filemask).&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Here is what's the job looks like:&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lu44.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/128102i9E59BEFA3463C7EB/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lu44.png" alt="0683p000009Lu44.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;As you can see, I have 2 separate subjobs linked&amp;nbsp;with a OnSubjob_Ok trigger for orchestration.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;1st tFileList is here (target, "*_META.txt" files only) :&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Ltp0.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/128668i2E01D42B7B13F052/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Ltp0.png" alt="0683p000009Ltp0.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;2nd&amp;nbsp;tFileList is here (target, *.txt" files &lt;STRONG&gt;but&lt;/STRONG&gt; "*_META.txt"):&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Ltua.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147847i0059A7499A695788/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Ltua.png" alt="0683p000009Ltua.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;And the Advanced settings for this component (for *"_META.txt" exclusion):&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Ltwz.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/146805i2584113AD9D3B026/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Ltwz.png" alt="0683p000009Ltwz.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;You got it?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 07:30:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Filename-validation-in-talend/m-p/2250534#M34747</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-05-05T07:30:36Z</dc:date>
    </item>
  </channel>
</rss>

