Announcement

Collapse
No announcement yet.

Script to create series of HTML reports

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Script to create series of HTML reports

    I use BC to compare two folders, and for each highlighted match create an individual HTML report. This often means scrolling through folders with hundreds of files & manually creating dozens of HTML reports. Anyone think this could be automated? Thanks.

  • #2
    Hello,

    Which report style are you currently using? Are you generating a Folder Report with included links to file reports? This report can be generated in the interface or using BC Scripting automation (from the Command Line). The report output itself would still be the same. Are you looking for the automation of this report layout, or a report that includes all file content in a single file?

    You can also generate a File Report from the folder level. To do this, load your Folder Compare, set to Display Differences, use the Edit menu -> Expand All, Edit menu -> Select All Files to get a select of all files in all subfolders. Then go to the Actions menu (or right click the selection) and select File Compare Report. This will then generate a single report of all the selected file content.
    If the command is missing from the Actions menu, it means a folder or archive was selected. You can set the Session Settings to treat archives as Folders or Files explicitly (to select them or their content) or a file name filter to remove the problem archives from the view so they aren't selected during the Select All Files command.
    Aaron P Scooter Software

    Comment


    • #3
      Hi Aaron,
      Thanks for the quick and informative reply. I'm completely new to BC, and so will do some learning about scripting, etc.

      To your question, the actual task & data structure is simpler than you describe. I compare two folders, basically "old" and "new," that each have > 1,000 .xml files, no subfolders. There will be file name matches, possibly hundreds, showing that the "new" folder contains updated versions of some files in the "old" folder.

      For each match, I need to generate an HTML report showing the differences. The file names are identical in format, so I'd like to end up with a new folder containing one HTML report for each match - ABC001.html, ABC005.html, ABC037.html, etc.
      Thanks, Kevin

      Comment


      • #4
        Hi Aaron,
        Another newbie question. I'm trying to create/run scripts based on your sample code, but no matter what folder I'm in, what pathname I use, any variation of "bcomp" or "bcompare" results in "command not found." Any help appreciated. PS I'm on a Mac with the latest Mojave. Thanks much.

        Comment


        • #5
          On Mac, run Beyond Compare > Install Command Line Tools to enable bcomp and bcompare in Terminal.
          Chris K Scooter Software

          Comment


          • #6
            I've started experimenting with your sample scripting code; pretty cool. The attached screen shot shows a folder compare, with Peek turned on. It shows exactly what I need - which files are in each folder *and* have been updated. Two question: 1) Does BC show me anywhere how many of those highlighted matches there are, and 2) Is there a way to batch-create an HTML file compare report for each of the matches? Thanks.
            Attached Files

            Comment


            • #7
              Hello,

              Peek allows you to temporarily disable items that have been filtered out, and show everything. If you want to see everything, it may be better to alter your filters to include those items, which the report can then also include. Is the Display Filter (upper left toolbar): Show All the view you are looking for?

              You can then generate different folder reports from the Session menu -> Folder Compare Report dialog. With output as HTML and layout as Side by side, this can "include file links", which are individual reports for each of the included file pairs. You will probably want to limit the Folder Compare Report to just Differences; otherwise it will include a report for every equal pair of files, too.

              Once we have a good combination of settings and a report generating in the interface, we can help with the script commands needed to call that same report generation from the command line.
              Aaron P Scooter Software

              Comment

              Working...
              X