I am new to Talend. I want to create a dynamic name for writing the files. The flow is like cFile is consuming Four files from the directory then aggregate to one File on the basis of the file name and in cProcessor again get the list of file name and folllowed by csplitter and then again cfile genertaes 4 files with source file name and the body.
here is the code for cProcessor:
List<String> fileList = new ArrayList<String>();
fileList = (List<String>)exchange.getProperty("CamelFileName");
System.out.println("After aggregation the fileName: "+
List<String> listBody = new ArrayList<String>();
listBody = (List<String>)exchange.getProperty("body");
System.out.println("After aggregation the body: "+ listBody);
You should use a java bean and use a static list of string to store your filenames, then after the split, according to the message number (1,2,3 or 4) set it the name in the list (the correct header is CamelFileName)
Try Talend Cloud free for 30 days.
Introduction to Talend Open Studio for Data Integration.
Practical steps to developing your data integration strategy.
Create systems and workflow to manage clean data ingestion and data transformation.