<?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: File Transfer in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361560#M125877</link>
    <description>Hi Pedro,&lt;BR /&gt;Sorry its the 27th character, if you start from 0. So right now I have the following code in my tfilecopy component&lt;BR /&gt;---------------&lt;BR /&gt;((String)globalMap.get("tForeach_1_CURRENT_VALUE")).substring(0,19)+((String)globalMap.get("tForeach_1_CURRENT_VALUE")).substring(23,27)+((String)globalMap.get("tForeach_1_CURRENT_VALUE")).substring(19,23)+"_"+"Op2"+"_"+((String)globalMap.get("tForeach_1_CURRENT_VALUE")).substring(28,((String)globalMap.get("tForeach_1_CURRENT_VALUE")).length())&lt;BR /&gt;----------------&lt;BR /&gt;So should I be using tIterateflow instead of tforeach?. Will try as you suggested.&lt;BR /&gt;Thanks,</description>
    <pubDate>Fri, 23 Mar 2012 13:03:43 GMT</pubDate>
    <dc:creator>ar7368</dc:creator>
    <dc:date>2012-03-23T13:03:43Z</dc:date>
    <item>
      <title>File Transfer</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361558#M125875</link>
      <description>Hi, 
&lt;BR /&gt;I have a job to modify filenames of files(pdf) from source with static data inserted in the fourth component of file name such that it will have the following format 
&lt;BR /&gt;TAC_CAT_time/date_Op2_uniqueID.pdf. The filenames will already contain TAC_CAT_DATE_unique ID.pdf. thus Op2 (case sensitive) is missing. The TAC and CAT components are 8 and 9 characters long respectively. I have figured out all of the above, except that when the MRN or HAR are not within 8 or 9 characters long i need to generate a error. Sometimes these components are keyed in wrong by users. How do I filter these files? to generate a email. 
&lt;BR /&gt;So in effect the 28th character in my filename needs to "_".</description>
      <pubDate>Fri, 23 Mar 2012 01:02:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361558#M125875</guid>
      <dc:creator>ar7368</dc:creator>
      <dc:date>2012-03-23T01:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: File Transfer</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361559#M125876</link>
      <description>Hi
&lt;BR /&gt;
&lt;PRE&gt;So in effect the 28th character in my filename needs to "_".&lt;/PRE&gt;
&lt;BR /&gt;According to your requirement, we can create part of your job as follow.
&lt;BR /&gt;Regards,
&lt;BR /&gt;Pedro</description>
      <pubDate>Fri, 23 Mar 2012 05:57:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361559#M125876</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-03-23T05:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: File Transfer</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361560#M125877</link>
      <description>Hi Pedro,&lt;BR /&gt;Sorry its the 27th character, if you start from 0. So right now I have the following code in my tfilecopy component&lt;BR /&gt;---------------&lt;BR /&gt;((String)globalMap.get("tForeach_1_CURRENT_VALUE")).substring(0,19)+((String)globalMap.get("tForeach_1_CURRENT_VALUE")).substring(23,27)+((String)globalMap.get("tForeach_1_CURRENT_VALUE")).substring(19,23)+"_"+"Op2"+"_"+((String)globalMap.get("tForeach_1_CURRENT_VALUE")).substring(28,((String)globalMap.get("tForeach_1_CURRENT_VALUE")).length())&lt;BR /&gt;----------------&lt;BR /&gt;So should I be using tIterateflow instead of tforeach?. Will try as you suggested.&lt;BR /&gt;Thanks,</description>
      <pubDate>Fri, 23 Mar 2012 13:03:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361560#M125877</guid>
      <dc:creator>ar7368</dc:creator>
      <dc:date>2012-03-23T13:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: File Transfer</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361561#M125878</link>
      <description>Hi Pedro, 
&lt;BR /&gt;The job ran as you suggested. But in the destination folder I can see just one file that is transferred. The rest of the files are missing eventhough the job says it moved 11 files which is the correct number. I'm missing something here. Please help. 
&lt;BR /&gt;Thanks,</description>
      <pubDate>Fri, 23 Mar 2012 16:33:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361561#M125878</guid>
      <dc:creator>ar7368</dc:creator>
      <dc:date>2012-03-23T16:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: File Transfer</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361562#M125879</link>
      <description>Hi&lt;BR /&gt;From this image, we are sure that tFilerRow works fine.&lt;BR /&gt;It seems that there is something wrong in tFileCopy.&lt;BR /&gt;You'd better recheck it.&lt;BR /&gt;Regards,&lt;BR /&gt;Pedro</description>
      <pubDate>Mon, 26 Mar 2012 03:13:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361562#M125879</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-03-26T03:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: File Transfer</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361563#M125880</link>
      <description>Hi Pedro, 
&lt;BR /&gt;I just can't isolate the problem, Following are the screens when I use tlogrow and alternatively when I use tfilecopy 
&lt;BR /&gt;The destination filename code I have on Tfilecopy is as follows 
&lt;BR /&gt;---------------------------- 
&lt;BR /&gt;((String)globalMap.get("tFileList_1_CURRENT_FILE")).substring(0,19)+((String)globalMap.get("tFileList_1_CURRENT_FILE")).substring(23,27)+((String)globalMap.get("tFileList_1_CURRENT_FILE")).substring(19,23)+"_"+"Op2"+"_"+((String)globalMap.get("tFileList_1_CURRENT_FILE")).substring(32,((String)globalMap.get("tFileList_1_CURRENT_FILE")).length()) 
&lt;BR /&gt;------------------------------- 
&lt;BR /&gt;When Tfilecopy is used with Tfilter will the files transfer or is Tfilter used to just list the filtered files but no physically move them?</description>
      <pubDate>Mon, 26 Mar 2012 14:38:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361563#M125880</guid>
      <dc:creator>ar7368</dc:creator>
      <dc:date>2012-03-26T14:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: File Transfer</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361564#M125881</link>
      <description>Sorry that is not the case. Its 5 parts before the insertion of "Op2" a constant. The destination files need to have 6 parts in total.</description>
      <pubDate>Mon, 26 Mar 2012 15:17:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361564#M125881</guid>
      <dc:creator>ar7368</dc:creator>
      <dc:date>2012-03-26T15:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: File Transfer</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361565#M125882</link>
      <description>I've got this routine for splitting strings into parts on a delimiter. 
&lt;BR /&gt; 
&lt;PRE&gt;    /**&lt;BR /&gt;     * reverseIt() Reverses a string.&lt;BR /&gt;     * &lt;BR /&gt;     * {talendTypes} String&lt;BR /&gt;     * &lt;BR /&gt;     * {Category} Ncl_routines&lt;BR /&gt;     * &lt;BR /&gt;     * {param} string ("fred") input: the string to be reversed&lt;BR /&gt;     * &lt;BR /&gt;     * {example} reverseIt("fred") # derf&lt;BR /&gt;     * &lt;BR /&gt;     */  &lt;BR /&gt;	public static String reverseIt(String source) {&lt;BR /&gt;		    int i, len = source.length();&lt;BR /&gt;		    StringBuffer dest = new StringBuffer(len);&lt;BR /&gt;		    for (i = (len - 1); i &amp;gt;= 0; i--)&lt;BR /&gt;		      dest.append(source.charAt(i));&lt;BR /&gt;		    return dest.toString();&lt;BR /&gt;	}&lt;BR /&gt;   /**&lt;BR /&gt;     * anyWord() finds a word in a string based on a delimiter and the number of the word required.&lt;BR /&gt;     * It can search forwards or backwards depending on whether the number of the word is positive or negative.&lt;BR /&gt;     * &lt;BR /&gt;     * {talendTypes} String&lt;BR /&gt;     * &lt;BR /&gt;     * {Category} Ncl_routines&lt;BR /&gt;     * &lt;BR /&gt;     * {param} string("hello Example") input: The string need to be parsed.&lt;BR /&gt;     * &lt;BR /&gt;     * {param} string(" ") input: the delimiter&lt;BR /&gt;     * &lt;BR /&gt;     * {param} int(0) input: the number of the word to return - 0 is first occurrence -1 is the last.&lt;BR /&gt;     * &lt;BR /&gt;     * {example} anyWord("hello Example"," ",0) # hello&lt;BR /&gt;     */&lt;BR /&gt; &lt;BR /&gt;	@SuppressWarnings("finally")&lt;BR /&gt;	public static String anyWord(String message, String delimiter, Integer number ) {&lt;BR /&gt;    	String returnString = null;&lt;BR /&gt;    	Integer reverseit = 0;&lt;BR /&gt;    	try {&lt;BR /&gt;	    	if (number &amp;lt; 0) {&lt;BR /&gt;	    		message = Ncl_routines.reverseIt(message);&lt;BR /&gt;	    		number = -1 - number;&lt;BR /&gt;	    		reverseit = 1;&lt;BR /&gt;	    }&lt;BR /&gt;    	if (delimiter.equals(" ")) {&lt;BR /&gt;    		String[] starwords = message.split (" ");&lt;BR /&gt;    		returnString = starwords;&lt;BR /&gt;    	}&lt;BR /&gt;    	if (! delimiter.equals(" ")) {&lt;BR /&gt;    		String[] starwords = message.split ("\\" + delimiter);&lt;BR /&gt;    		returnString = starwords;&lt;BR /&gt;    	}&lt;BR /&gt;    	if (reverseit == 1) {&lt;BR /&gt;    		returnString = Ncl_routines.reverseIt(returnString);&lt;BR /&gt;    	}&lt;BR /&gt;    	} catch (ArrayIndexOutOfBoundsException e) {&lt;BR /&gt;    		returnString = "";&lt;BR /&gt;    	} finally {&lt;BR /&gt;    		return returnString;&lt;BR /&gt;    	}&lt;BR /&gt;    } &lt;BR /&gt;}&lt;/PRE&gt; 
&lt;BR /&gt;So for your string you could have 
&lt;BR /&gt;anyWord(((String)globalMap.get("tFileList_1_CURRENT_FILE")),"-",0) + "_" + anyWord(((String)globalMap.get("tFileList_1_CURRENT_FILE")),"-",1) + "_" + 
&lt;BR /&gt;anyWord(((String)globalMap.get("tFileList_1_CURRENT_FILE")),"-",2) + "_" + 
&lt;BR /&gt;anyWord(((String)globalMap.get("tFileList_1_CURRENT_FILE")),"-",3) + "_" + 
&lt;BR /&gt;"Op2_" + 
&lt;BR /&gt;anyWord(((String)globalMap.get("tFileList_1_CURRENT_FILE")),"-",4) 
&lt;BR /&gt; 
&lt;BR /&gt;This saves worying about the length of each component. 
&lt;BR /&gt;"</description>
      <pubDate>Mon, 26 Mar 2012 15:29:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361565#M125882</guid>
      <dc:creator>janhess</dc:creator>
      <dc:date>2012-03-26T15:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: File Transfer</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361566#M125883</link>
      <description>Ok the third component is a date which is in mmddyyyy, I need it in yyyymmdd. So how do i deal with that?. I am currently using the following in the 3rd component.
&lt;BR /&gt;-----------
&lt;BR /&gt;((String)globalMap.get("tFileList_1_CURRENT_FILE")).substring(23,27)+((String)globalMap.get("tFileList_1_CURRENT_FILE")).substring(19,23)
&lt;BR /&gt;-----------
&lt;BR /&gt;Could I use the one above in the 3rd part of your code ?</description>
      <pubDate>Mon, 26 Mar 2012 15:42:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361566#M125883</guid>
      <dc:creator>ar7368</dc:creator>
      <dc:date>2012-03-26T15:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: File Transfer</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361567#M125884</link>
      <description>Do the substring on the anyWord.</description>
      <pubDate>Mon, 26 Mar 2012 16:55:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361567#M125884</guid>
      <dc:creator>janhess</dc:creator>
      <dc:date>2012-03-26T16:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: File Transfer</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361568#M125885</link>
      <description>The problems still persists. There is just one file each ( one from the filter and other from reject) moved to the destination folders. Why is this?. I have no clue why just one file is moved to the destination although the job says otherwise.</description>
      <pubDate>Tue, 27 Mar 2012 15:35:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361568#M125885</guid>
      <dc:creator>ar7368</dc:creator>
      <dc:date>2012-03-27T15:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: File Transfer</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361569#M125886</link>
      <description>What are the input and output file names for your file copy?&lt;BR /&gt;Your tFilterRow should use .equals not ==</description>
      <pubDate>Tue, 27 Mar 2012 16:02:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361569#M125886</guid>
      <dc:creator>janhess</dc:creator>
      <dc:date>2012-03-27T16:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: File Transfer</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361570#M125887</link>
      <description>For tfilecopy1: 
&lt;BR /&gt;Filename is : ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")) 
&lt;BR /&gt;Destiantion Filename : ((String)globalMap.get("tFileList_1_CURRENT_FILE")).substring(0,19)+((String)globalMap.get("tFileList_1_CURRENT_FILE")).substring(23,27)+((String)globalMap.get("tFileList_1_CURRENT_FILE")).substring(19,23)+"_"+"Op2"+"_"+((String)globalMap.get("tFileList_1_CURRENT_FILE")).substring(32,((String)globalMap.get("tFileList_1_CURRENT_FILE")).length()) 
&lt;BR /&gt;-------------------------------------------------------------------------- 
&lt;BR /&gt;For tfilecopy 3: Filename is : ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")) 
&lt;BR /&gt;Destiantion : Local drive. 
&lt;BR /&gt; 
&lt;BR /&gt;I know you suggested using routines but I haven't. Still there is no explanation to why just a single file gets moved but not the rest</description>
      <pubDate>Tue, 27 Mar 2012 16:07:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361570#M125887</guid>
      <dc:creator>ar7368</dc:creator>
      <dc:date>2012-03-27T16:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: File Transfer</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361571#M125888</link>
      <description>You need to use the file name from tFilterRow for the output file name. The one from tFileList will always be the same as it's before the iterate.</description>
      <pubDate>Tue, 27 Mar 2012 16:09:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361571#M125888</guid>
      <dc:creator>janhess</dc:creator>
      <dc:date>2012-03-27T16:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: File Transfer</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361572#M125889</link>
      <description>you mean in Rename - destination fielname?</description>
      <pubDate>Tue, 27 Mar 2012 16:22:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361572#M125889</guid>
      <dc:creator>ar7368</dc:creator>
      <dc:date>2012-03-27T16:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: File Transfer</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361573#M125890</link>
      <description>Sorry I'm talking rubbish - tFileList file name is after the iteration.&lt;BR /&gt;What does the tLogRow show for the file name in your earlier example?</description>
      <pubDate>Tue, 27 Mar 2012 16:46:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361573#M125890</guid>
      <dc:creator>janhess</dc:creator>
      <dc:date>2012-03-27T16:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: File Transfer</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361574#M125891</link>
      <description>Ok, the tlogrows shows the rejects and filtered files according to the condition specified in tfilterrows. I have merely replace the tlogrows with tfilecopy in the earlier example.</description>
      <pubDate>Tue, 27 Mar 2012 16:53:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361574#M125891</guid>
      <dc:creator>ar7368</dc:creator>
      <dc:date>2012-03-27T16:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: File Transfer</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361575#M125892</link>
      <description>When I hit ctrl+space in Tfilecopy destination rename should I be choosing &lt;BR /&gt;"((Integer)globalMap.get("tFilterRow_3_NB_LINE_OK"))"... but what is the Integer part?.</description>
      <pubDate>Tue, 27 Mar 2012 16:58:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361575#M125892</guid>
      <dc:creator>ar7368</dc:creator>
      <dc:date>2012-03-27T16:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: File Transfer</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361576#M125893</link>
      <description>OK I think the input file name is in the column name that comes out of tFilterRow - that's why it's displayed in tLogRow.&lt;BR /&gt;Does the file that's being created look like any of the names you're expecting?</description>
      <pubDate>Tue, 27 Mar 2012 17:07:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361576#M125893</guid>
      <dc:creator>janhess</dc:creator>
      <dc:date>2012-03-27T17:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: File Transfer</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361577#M125894</link>
      <description>yes in the tfilecopy( good files) i see one file with the modifications I have specified. Similarly in tfilecopy(reject files), I see one file that is not according to specifications. So of the 20 rows processed 9 are bad and 11 good. Problem: I see just one of each category in their respective destinations.</description>
      <pubDate>Tue, 27 Mar 2012 17:12:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-Transfer/m-p/2361577#M125894</guid>
      <dc:creator>ar7368</dc:creator>
      <dc:date>2012-03-27T17:12:44Z</dc:date>
    </item>
  </channel>
</rss>

