Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Copy the list of file to another folder with Condition

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:  

 

0683p000009M9Ph.jpg0683p000009M9WN.jpg0683p000009M9Pi.jpg0683p000009M8v0.jpg

 

Labels (2)
9 Replies
manodwhb
Champion II
Champion II

Since string data type fields you should compare like below.

Row1.col.equals("row2.col")

Anonymous
Not applicable
Author

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!

 

0683p000009M9XG.jpg0683p000009M9XL.jpg

manodwhb
Champion II
Champion II

@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".

 

Anonymous
Not applicable
Author

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?

 

0683p000009M9Q1.jpg0683p000009M9XV.jpg

I think maybe the first one with the expression equals and inner join is the logical one, no ? don't you think? thanks.

billimmer
Creator III
Creator III

Maybe simplify your process?  Since you only want to copy files that match the spreadsheet:

 

tFileInputExcel ---(main)--->tFlowToIterate---(iterate)--->tFileExists----(if yes)--->tFileCopy

 

Anonymous
Not applicable
Author

@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 ?

Anonymous
Not applicable
Author

@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.

 

manodwhb
Champion II
Champion II

You want to find the identical files then in Tampa output table, there is a property catch inner join rejects false should be set.
billimmer
Creator III
Creator III

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.