New archived content: Talend MDM, Talend Data Catalog 8.0, and Talend 7.3 products reached their end of life in 2024. Their documentation was moved to the Talend Archive page and will no longer receive content updates.
This scenario describes a Job unarchiving a file and comparing it to a reference file
to make sure it did not change. The output of the comparison is stored into a delimited
file and a message displays in the console.
Procedure
Procedure
Create the Job.
Place the following components:
tFileUnarchive,
tFileCompare,
tFileOutputDelimited.
Link the tFileUnarchive to the
tFileCompare with an Iterate connection.
Connect the tFileCompare to
the output component using a Main row
link.
In the Basic settings view of
the tFileUnarchive component, fill in the path
to the archive to unzip.
In the Extraction Directory
field, fill in the destination folder for the unarchived file.
In the Basic settings view of
the tFileCompare component, fill the File to compare field by clicking in the field,
pressing Ctrl + Space bar, and selecting
"((String)globalMap.get("tFileUnarchive_1_CURRENT_FILEPATH"))"
from the context menu.
This variable fetches the output file of the tFileUnarchive component.
Fill the path to the reference file in the Reference file field.
In the messages fields, set the messages you want to see if the
files differ or are identical.
For example: "[job " + JobName + "] Files
differ".
Select the Print to Console
option for the message defined to display at the end of the execution.
Information noteNote: The schema is read-only and contains standard information data. Click
Edit schema to look at it.
Set the output component as usual with semi-colon as data
separators.
Save your Job and press F6 to run it.
The message set is displayed in the console and the output shows
the schema information data.