Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Ven6
Contributor III
Contributor III

Compare excel file in different folder

Hello I have a problem.
I have two folders (new_folder and old_folder) with 50 excel files each.

I would like to create a job that compares each file in the folder new_folder  with those in the folder old_folder folder.
either file1 in the new_folder folder compares to file1 in the old_folder folder; either file2 in the new_folder folder compares to file2 in the old_folder folder so on ... the files are in the format file_date (yyyMMdd). extension example: the first file in the folders is file_20200101.xlsx

 

Out of it I would like to have different lines.

help please

Labels (2)
4 Replies
Anonymous
Not applicable

Does the file name is the same in both folder?
Ven6
Contributor III
Contributor III
Author

Yes it's the same

Anonymous
Not applicable

It is possible to compare the file contents with tFileCompare component, and return the result that shows the two files are identical or differ.
For example:
tFileList1--iterate--tFilecompare--runIf--tFixeFlowInput--main--tFileOutput

tFileList: iterate each files in new folder
on tFileCompare:
set the File to compare filed as:
((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))
set the Reference file field as:
"your old folder/"+((String)globalMap.get("tFileList_1_CURRENT_FILE"))

If the files are differ, output the current file name to a file, set the condition of runIf as:
!((Boolean)globalMap.get("tFileCompare_1_DIFFERENCE"))

on tFixedFlowInput: generate the current file name, define one column and set its value as:
((String)globalMap.get("tFileList_1_CURRENT_FILE"))

Regards
Shong
Ven6
Contributor III
Contributor III
Author

Tks for this 

 

but ,

I would like to have output different lines from each compared file.