<?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 parse delimited filename in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/parse-delimited-filename/m-p/2209416#M8249</link>
    <description>Hi 
&lt;BR /&gt;I get files to this effect:
&lt;BR /&gt;DATETIME FILETYPE GUID MD5
&lt;BR /&gt;20120730110652-CommissionLoad-88ceb41d-c378-4bb6-a758-e69497f378ab-8d6e0d8960b2decb5d433346cb5bda0c
&lt;BR /&gt;the files are dynamic. I search for the file using tFileList and look for *Commission*.txt , there are other file types eg. StaffLoad etc... 
&lt;BR /&gt;I need to parse the filename and store the different sections of the filename into (i assume) context variables, as I need to : 
&lt;BR /&gt;a. calculate the MD5 of the file and compare it to the MD5 in the filename
&lt;BR /&gt;b. write to a table the file details and a status of whether the file was read properly , corrupt etc...
&lt;BR /&gt;I am unsure of how to effect this.
&lt;BR /&gt;Regards</description>
    <pubDate>Wed, 01 Aug 2012 12:03:24 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-08-01T12:03:24Z</dc:date>
    <item>
      <title>parse delimited filename</title>
      <link>https://community.qlik.com/t5/Talend-Studio/parse-delimited-filename/m-p/2209416#M8249</link>
      <description>Hi 
&lt;BR /&gt;I get files to this effect:
&lt;BR /&gt;DATETIME FILETYPE GUID MD5
&lt;BR /&gt;20120730110652-CommissionLoad-88ceb41d-c378-4bb6-a758-e69497f378ab-8d6e0d8960b2decb5d433346cb5bda0c
&lt;BR /&gt;the files are dynamic. I search for the file using tFileList and look for *Commission*.txt , there are other file types eg. StaffLoad etc... 
&lt;BR /&gt;I need to parse the filename and store the different sections of the filename into (i assume) context variables, as I need to : 
&lt;BR /&gt;a. calculate the MD5 of the file and compare it to the MD5 in the filename
&lt;BR /&gt;b. write to a table the file details and a status of whether the file was read properly , corrupt etc...
&lt;BR /&gt;I am unsure of how to effect this.
&lt;BR /&gt;Regards</description>
      <pubDate>Wed, 01 Aug 2012 12:03:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/parse-delimited-filename/m-p/2209416#M8249</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-01T12:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: parse delimited filename</title>
      <link>https://community.qlik.com/t5/Talend-Studio/parse-delimited-filename/m-p/2209417#M8250</link>
      <description>Hi
&lt;BR /&gt;You might use tFileList, tFixedFlowInput and tFileOutputDelimited to store all these filenames.
&lt;BR /&gt;Then use tFileInputPostional to extract these four columns to store in db table.
&lt;BR /&gt;For MD5, you might use tFileProperties to get MD5 of each file and compare it with tFileInputPositional.
&lt;BR /&gt;Regards,
&lt;BR /&gt;Pedro</description>
      <pubDate>Thu, 02 Aug 2012 02:58:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/parse-delimited-filename/m-p/2209417#M8250</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-02T02:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: parse delimited filename</title>
      <link>https://community.qlik.com/t5/Talend-Studio/parse-delimited-filename/m-p/2209418#M8251</link>
      <description>apologies ... how do i get tFixedFlowInput to store the filenames . I cannot seem to get this right.
&lt;BR /&gt;I have done this as a work around but cannot seem to get it to work .
&lt;BR /&gt;in tJavaRow
&lt;BR /&gt;i have some basic code, I am taking the output from tfileproperties (ie tfilelist -----iterate-----&amp;gt;tfileproperties----main----&amp;gt; tjavarow
&lt;BR /&gt;
&lt;BR /&gt;String basename;
&lt;BR /&gt;String md5;
&lt;BR /&gt;String ImpGuid;
&lt;BR /&gt;String delim = "-";
&lt;BR /&gt;globalMap.put("basename",input_row.basename);
&lt;BR /&gt;globalMap.put("md5",input_row.md5);
&lt;BR /&gt;System.out.println("########MD5##########");
&lt;BR /&gt;System.out.println(input_row.md5);
&lt;BR /&gt;System.out.println("######Basename#######");
&lt;BR /&gt;System.out.println(globalMap.get("basename"));
&lt;BR /&gt;System.out.println("########==FILENAME==##########");
&lt;BR /&gt;System.out.println(((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")));
&lt;BR /&gt;//basename = toString(input_row.basename); //does not work cannot convert from object to string
&lt;BR /&gt;//basename = ((String)globalMap.get(globalMap.get("basename")) //does not work 
&lt;BR /&gt;//String tokens[] = basename.split(delim);
&lt;BR /&gt;for (int i = 0; i &amp;lt; input_row.basename.length; i++)
&lt;BR /&gt;{
&lt;BR /&gt; System.out.println(input_row.basename
&lt;I&gt;); //just to read what i have for now &lt;BR /&gt;}&lt;BR /&gt;I was thinking of reading on the string and assigning the different parts to a context variables but when i try cast or convert to string ...&lt;/I&gt;</description>
      <pubDate>Thu, 02 Aug 2012 13:23:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/parse-delimited-filename/m-p/2209418#M8251</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-02T13:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: parse delimited filename</title>
      <link>https://community.qlik.com/t5/Talend-Studio/parse-delimited-filename/m-p/2209419#M8252</link>
      <description>Hi
&lt;BR /&gt;You might save all filenames in a delimited file as the following images.
&lt;BR /&gt;Regards,
&lt;BR /&gt;Pedro</description>
      <pubDate>Fri, 03 Aug 2012 02:33:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/parse-delimited-filename/m-p/2209419#M8252</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-03T02:33:23Z</dc:date>
    </item>
  </channel>
</rss>

