Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I want to compare files in folder with the list of names in an excel file, depending on the condition: if the filenames are identical, the job copies them to a new Folder.
I based myself on this topic according to memeber fdenis (https://community.talend.com/t5/Design-and-Development/Copy-the-list-of-file-to-other-folder/m-p/131...)
I'm almost close, but I don't know why it doesn't take the condition into consideration in the component Tmap, can you help me please?
Here are some screenshots:
Hello
Thanks for replying Manohar
You mean this comparaison: row1.col.equals("row4.col")
I just did it in Component Tmap, but it dosen't work ? the comparison is between Column "basename" from tFilelist and column "ACIName" from InputDelimited file, and I must copy the list of identical files!
@shadw85, even you do not need that expression, since you are doing an inner join. your inner join is not working means there is no matching between "basename" and "ACIName".
sorry for late answer, so I delete the expression ( row1.col.equals..) and execute just with inner join as you say Manohar, the result is it copy all the file in TFile list even if they are not identical, is that logical?
I think maybe the first one with the expression equals and inner join is the logical one, no ? don't you think? thanks.
Maybe simplify your process? Since you only want to copy files that match the spreadsheet:
tFileInputExcel ---(main)--->tFlowToIterate---(iterate)--->tFileExists----(if yes)--->tFileCopy
@manodwhb , when I apply only the inner join I get this result, it returns all the non identical files, when I search manually, I find some identical files in between! can you help me with this ?
@lli , I did not quite understand your proposal, I must compare the files from two different locations, a folder and an Excel file, I chose the TMap component, because I would need other comparison of data streams.
In the spreadsheet, there is a column with file names, correct? You wan to see which file names in the spreadsheet have matching files in a folder correct?
tFileInputExcel ---(main)--->tFlowToIterate---(iterate)--->tFileExists----(if yes)--->tFileCopy
When you use tFileInputExcel with tFlowToIterate, you can take the file name on each row of the spreadsheet and see if it exists in the folder with tFileExists. "If" it does, then you can do "something", like copy the file, log it, etc.
You can also use a tmap with tFileInputExcel and tFileList to do the same thing but it's a more complicated solution.