<?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: [resolved] tfilelist, check header row and match up columns in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-tfilelist-check-header-row-and-match-up-columns/m-p/2278415#M53898</link>
    <description>Hi, 
&lt;BR /&gt;thanks very much for your message, sounds like a sensible solution. I think I have an idea of how to do the below... but if you could give me an example that would be really great. 
&lt;BR /&gt;I've done a fair bit of java, so am quite happy to write some custom code (using tJavaRow instead of tmap if it makes more sense as you suggest)... it's just that i've never done java in Talend and am not quite sure how to start without some example code before. 
&lt;BR /&gt;Thank you very much
&lt;BR /&gt;P</description>
    <pubDate>Mon, 09 May 2011 10:11:54 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-05-09T10:11:54Z</dc:date>
    <item>
      <title>[resolved] tfilelist, check header row and match up columns</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tfilelist-check-header-row-and-match-up-columns/m-p/2278413#M53896</link>
      <description>Hello, 
&lt;BR /&gt;I have a directory (unix) which has a number of files. I can extract all, for example, "filetype1.csv" using regex. 
&lt;BR /&gt;However some of these files of the same type have different headers and different numbers of columns which don't always match up or come in the same order. 
&lt;BR /&gt;I'm currently just going from tfilelist to a delimited file input. I would like to either 
&lt;BR /&gt;a) split it coming out of the directory based on what the header is (i.e if header matches regex1 then put into inputfile1, if header matches regex2 put into inputfile2), so the columns all match up in the merged file. Or... 
&lt;BR /&gt;b) just extract certain columns from the files before putting them altogether in the delimited input file, so I again the combination of all the inputs match up in terms of column headings. 
&lt;BR /&gt;Is there anyway to do this without writing custom java code to do it all? 
&lt;BR /&gt;Thanks 
&lt;BR /&gt;P</description>
      <pubDate>Sat, 16 Nov 2024 12:56:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tfilelist-check-header-row-and-match-up-columns/m-p/2278413#M53896</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T12:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tfilelist, check header row and match up columns</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tfilelist-check-header-row-and-match-up-columns/m-p/2278414#M53897</link>
      <description>for (a) there is a non-custom solution:
&lt;BR /&gt;1) read the header from each file (in the schema for your input, have a single column to hold the whole line)
&lt;BR /&gt;2) use a tMap to run your regex in the tMap output filter-- you will have one output table per target file. (this part would be cleaner with a tJavaRow)
&lt;BR /&gt;3) using an "if" link, read the input file with the correct input component.
&lt;BR /&gt;if you need more details, please ask... I can work up an example</description>
      <pubDate>Fri, 06 May 2011 18:59:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tfilelist-check-header-row-and-match-up-columns/m-p/2278414#M53897</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-06T18:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tfilelist, check header row and match up columns</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tfilelist-check-header-row-and-match-up-columns/m-p/2278415#M53898</link>
      <description>Hi, 
&lt;BR /&gt;thanks very much for your message, sounds like a sensible solution. I think I have an idea of how to do the below... but if you could give me an example that would be really great. 
&lt;BR /&gt;I've done a fair bit of java, so am quite happy to write some custom code (using tJavaRow instead of tmap if it makes more sense as you suggest)... it's just that i've never done java in Talend and am not quite sure how to start without some example code before. 
&lt;BR /&gt;Thank you very much
&lt;BR /&gt;P</description>
      <pubDate>Mon, 09 May 2011 10:11:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tfilelist-check-header-row-and-match-up-columns/m-p/2278415#M53898</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-09T10:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tfilelist, check header row and match up columns</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tfilelist-check-header-row-and-match-up-columns/m-p/2278416#M53899</link>
      <description>Just a note before you implement: I forgot that the tFileInputMSDelimited may make this much simpler. It is designed to work with single multischema files, but it may work for this problem. If it does, it would be as simple as:&lt;BR /&gt;tFileList&lt;BR /&gt;|&lt;BR /&gt;tFileInputMSDelimited--file1--&amp;gt;(rest of job for file 1)&lt;BR /&gt;                              |--file2--&amp;gt;(rest of job for file 2)&lt;BR /&gt;&lt;BR /&gt;Here's the original solution I envisioned.&lt;BR /&gt;tFileList&lt;BR /&gt;|&lt;BR /&gt;iterate&lt;BR /&gt;|&lt;BR /&gt;tFileInputDelimited-row-&amp;gt;tJavaRow--if--&amp;gt;tFileInputDelimited --&amp;gt; (rest of job for file 1)&lt;BR /&gt;                                                 |--if--&amp;gt;tFileInputDelimited --&amp;gt; (rest of job for file 2)&lt;BR /&gt;&lt;BR /&gt;in the first tFileInputDelimited, set it up to read one row into a single column. (by setting the limit to 1 and the field separator to "")&lt;BR /&gt;in the tJavaRow, set a context variable to the name of the file you want to run based on your regex logic. &lt;BR /&gt;i.e.&lt;BR /&gt;&lt;PRE&gt;if( input_row.header_line.matches("some crazy regex" )  ) {&lt;BR /&gt;     context.file_to_run = "file_1";&lt;BR /&gt;}&lt;/PRE&gt;&lt;BR /&gt;in the if links, check this variable to execute the correct file processing flow. i.e. :&lt;BR /&gt;&lt;PRE&gt;context.file_to_run.equals("file_1")&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 May 2011 17:05:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tfilelist-check-header-row-and-match-up-columns/m-p/2278416#M53899</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-09T17:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tfilelist, check header row and match up columns</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tfilelist-check-header-row-and-match-up-columns/m-p/2278417#M53900</link>
      <description>Hi John, &lt;BR /&gt;Thanks for your help,&lt;BR /&gt;P</description>
      <pubDate>Fri, 13 May 2011 08:41:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tfilelist-check-header-row-and-match-up-columns/m-p/2278417#M53900</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-13T08:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tfilelist, check header row and match up columns</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tfilelist-check-header-row-and-match-up-columns/m-p/2278418#M53901</link>
      <description>&lt;P&gt;I want to ask a question in continuation to this.&lt;/P&gt;
&lt;P&gt;What filename&amp;nbsp; do we select in FileInputDelimited component after the if statement ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 13:46:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tfilelist-check-header-row-and-match-up-columns/m-p/2278418#M53901</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-08T13:46:19Z</dc:date>
    </item>
  </channel>
</rss>

