No announcement yet.

Compare only the first 8 bytes of two files?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Compare only the first 8 bytes of two files?

    I have two files, both with an employee number at the beginning of the file. The first file contains only the employee number and the second file contains the employee number followed by additional employee information.

    Is is possible to compare two files by specific character positions in the files; i.e., just compare the first 8 characters and tell me if they are the same or different?

    If so, how can I do this?

    Thanks in advance,

  • #2
    Are the employee ids already in a sorted order? If so, you can define a grammar item to match on employee id, mark it as important, and mark Everything Else as Unimportant for the comparison. We have a KB article with video that goes into detail here:
    Beyond Compare is a multi-platform utility that combines directory compare and file compare functions in one package. Use it to manage source code, keep directories in sync, compare program output, etc.

    If they are not sorted yet, the Text Compare can also perform a conversion which sorts your lines in the Conversion tab of the Text format in the Tools menu -> File Format dialog, or you can use the Data Compare.

    The Data Compare can be configured to have the EmployeeID in the first row (which would sort and align it), then mark Column 2 as Unimportant.

    Let us know if you have any questions.
    Aaron P Scooter Software