No announcement yet.

compare files from different locations

  • Filter
  • Time
  • Show
Clear All
new posts

  • compare files from different locations

    Hey all. Is it possible to create a script to compare files in different locations? For example, compare file a in folder a to file b in folder b - then, in the same session, file c in folder c to file d in folder d. I need to do this from the command line, and due to the number of files I don't want to launch a separate instance of bc2 for each comparison. Thanks!

  • #2
    Re: compare files from different locations

    There isn't a single command to do this. When comparing multiple files, BC will only match up files for comparison if their path and filenames are the same relative to the loaded base folders.

    You can script BC to generate a file comparison report of named files, but it will create a separate report for each pair of files.

    Here's an example script:

    file-report layout:side-by-side output-to:report1.txt c:\foldera\filea.txt c:\folderb\fileb.txt
    file-report layout:side-by-side output-to:report2.txt c:\folderc\filec.txt c:\folderd\filed.txt

    You can also pass in the file names to the script from the command line.

    file-report layout:side-by-side output-to:%3 %1 %2

    The call the script from a batch file for each pair of files:

    bc2.exe @script.txt c:\file1.txt c:\file2.txt c:\report.txt
    Chris K Scooter Software


    • #3
      Re: compare files from different locations

      Dear Chris,

      I think many users might have need like generate the report (esp statitics) for differnt set of files in one report!!

      If we have a option with select which can add the list of files to right side and corresponding file to left side for the comaprision and generate a final report wont it be good?

      select-files rt->c:\foldera\filea.txt lt->c:\folderb\fileb.txt
      select-files rt->c:\folderc\filec.txt lt->c:\folderd\filed.txt
      file-report .....

      May be in the next release this option will add value to the product!



      • #4
        Re: compare files from different locations


        Thanks for the suggestion. I'll add this to our wish list for our developers to review.
        Chris K Scooter Software