You are not logged in.
i have files in a folder with date at the end of their names as shown in figure 1. I want to iterate all these files by using tFileList but want to forward only those files which match the current date. I do this by adding a 'Run if' trigger on TFileList. The if condition is shown in figure 2. I have run the code seperately and it works fine but when i add this code to 'if' condition it gives 'index out of range'. The error is shown in figure 3.
Figure 4 shows the whole job.
Last edited by asa436 (2011-11-23 09:29:54)
You made a wrong upload, because i can't find figure 1.
Just type the names next time.
When String.indexOf("xxx") can't find "xxx", it will return -1.
So the method StringHandling.LEFT() get a wrong expression like this.
Then you got the error "String index out of range:-1".
Thanks for the reply.
i think the upload is ok, Figure 1 is the left most figure showing the zip files present in the folder.
then the next figure shows the 'if' condition code and so on as i mentioned earlier.
and i test the if condition on tJava where i printed "strings matched" through this if condition. Everything worked fine there.
please let me know if there is anything missing that you need to solve this issue.
The expression globalMap.get("tFileList_1_CURRENT_FILE").indexOf("201") leads to the error.
If directory which is seted in tFileList doesn't contains a file "*201*.rar", the error will occurs.
Please show me the basic settings of tFileList, or recheck it whether there is a file named "*201" in the directory.
Why you don't use :
tFileList --ITERATE--> tFileProperties. In your tFileList you put a mask like this sample :
"AccountCN_" + TalendDate.formatDate("yyyy_MM_dd", new Date()) + ".zip"
"*" + TalendDate.formatDate("yyyy_MM_dd", new Date()) + "*"
"*" + TalendDate.formatDate("yyyy_MM_dd", new Date()) + ".*"
Hi Thomas Maurin,
File mask in tFileList_1 worked perfectly, thanks a lot
"*" + StringHandling.TRIM(TalendDate.formatDate("yyyy_MM_dd ",TalendDate.getCurrentDate())) + ".zip"
may i get your contact email or any other contact to ask about few queries ...
Abdus Saboor Ahmad
@skype : asa436
Profile @ Linkedin:http://pk.linkedin.com/in/asa436
Last edited by asa436 (2011-11-25 08:55:44)