Skip to main content Skip to complementary content
  • 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.
Close announcements banner

Comparing unzipped files

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.

Job description.

Procedure

Procedure

  1. Create the Job.
    1. Place the following components:
      • tFileUnarchive,
      • tFileCompare,
      • tFileOutputDelimited.
    2. Link the tFileUnarchive to the tFileCompare with an Iterate connection.
    3. Connect the tFileCompare to the output component using a Main row link.
  2. In the Basic settings view of the tFileUnarchive component, fill in the path to the archive to unzip.
  3. In the Extraction Directory field, fill in the destination folder for the unarchived file.
  4. 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.
    Basic settings view for tFileCompare.
  5. Fill the path to the reference file in the Reference file field.
  6. In the messages fields, set the messages you want to see if the files differ or are identical.
    For example: "[job " + JobName + "] Files differ".
  7. 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.
  8. Set the output component as usual with semi-colon as data separators.
  9. Save your Job and press F6 to run it.
    Job results.
    The message set is displayed in the console and the output shows the schema information data.
    Schema information data.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!