Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have used tFileList in Talend to get files from a VM remote, which will be generated each day. I want to I want to pick files only for the past hour and do the required processing. I have referred to this question in StackOverflow like below :
How to process files only for the past hour using Talend?
I am stuck at step of writing code in tJavaRow. The error is : # "output_row cannot be resolved to a variable" Here is my job : .
Here is my code in tJavaRow_1 :
((String)globalMap.get("tFileList_5_CURRENT_FILEPATH")) = input_row
Date lastModifiedDate = TalendDate.parseDate("EEE MMM dd HH:mm:ss zzz yyyy", input_row.mtime_string);
Date current_date = TalendDate.getCurrentDate();
if(TalendDate.diffDate(current_date, lastModifiedDate,"dd") <= 15) {
output_row.abs_path = input_row.abs_path;
}
Could you help my to resolve this error.
I have tried some solutions but it didn't work. Like changing output_row to tJavaRow_1 or Output because I see this schema of tJavaRow_1:
Hi @Anh Nguyen
You need to connect tJavaRow to an output component to be able to use "output_row".
It seems you want to store the absolute path for those files recently modified and read those files using tFileInputDelimited.
If that's the case, you can use a globaL variable instead of output_row:
if (TalendDate.diffDate(current_date, lastModifiedDate,"dd") <= 15) {
gobalMap.put("path", input_row.abs_path);
}
Then you can use this variable on your If trigger or tFileInputDelimited:
((String)globalMap.get("path"))
Hi @Anh Nguyen
You need to connect tJavaRow to an output component to be able to use "output_row".
It seems you want to store the absolute path for those files recently modified and read those files using tFileInputDelimited.
If that's the case, you can use a globaL variable instead of output_row:
if (TalendDate.diffDate(current_date, lastModifiedDate,"dd") <= 15) {
gobalMap.put("path", input_row.abs_path);
}
Then you can use this variable on your If trigger or tFileInputDelimited:
((String)globalMap.get("path"))
Thank, I have found answer.