Hello Andybrown
Here I show you a demo job, feel free to post your question if you have any trouble.
code on tJavaRow_1:
//Code generated according to input schema and output schema
if(input_row.date.length()==5){ //like: 11301
output_row.basename = input_row.basename;
output_row.date = TalendDate.parseDate("Mddyy",input_row.date);
}
else{ //the length of date is 6, like 111209
output_row.basename = input_row.basename;
output_row.date = TalendDate.parseDate("MMddyy",input_row.date);
}
the destination filename on tFIleCopy_1:
((String)globalMap.get("tFileList_1_CURRENT_FILE")).substring(0,((String)globalMap.get("tFileList_1_CURRENT_FILE")).lastIndexOf("."))
About usage of tFlowToIterate component, see 5827
Best regards
shong