Script Output to HTML

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yakash
    Visitor
    • Oct 2004
    • 5

    Script Output to HTML

    I need the comparison output in HTML format. Tried following command in script: output-to:"C:\ABC\XYZ.html [output-options:html-color] [C:\ABC\D XYZ.html] - Doesn't work. Works fine with text file. Pls help.
  • Chris
    Team Scooter
    • Oct 2007
    • 5538

    #2
    Re: Script Output to HTML

    The convention in the scripting reference is that text in brackets is optional, [] characters aren't actually used in the script.

    To generate an html file comparison of the currently selected files, use syntax like:

    Code:
    file-report layout:side-by-side options:display-context	output-to:c:\report.html output-options:html-color
    If you're still having problems, please post your script.
    Chris K Scooter Software

    Comment

    • yakash
      Visitor
      • Oct 2004
      • 5

      #3
      Re: Script Output to HTML

      Here's a sample script. I checked the log file - it doesn't show any error message. It doesn't create the html file either.

      # Beyond Compare Script To Scan Windows Directory For Changes.
      #

      ################################################## ################################################## #

      # Turn logging on

      log verbose "C:\Beyond Compare\Windows-log.txt"


      # Load the base folders


      load "C:\Beyond Compare\Windows.bcss" "C:\Windows"

      expand all


      file-report layout:side-by-side options:display-mismatches output-to:C:\Beyond Compare\Windows-results.html output-options:html-color


      snapshot save-version rt output:"C:\Beyond Compare\Windows.bcss"

      ################################################## ################################################## ###

      Comment

      • Chris
        Team Scooter
        • Oct 2007
        • 5538

        #4
        Re: Script Output to HTML

        The file-report command operates on the currently selected files. If you add a select all statement between the expand all and file-report command it should generate the report.

        The file-report command will list a content comparison. If you're only interested in listing the names of different files you should use a folder-report command instead.

        In your snapshot, you're saving version information. If you want to compare timestamps, size, and version information, add the line criteria version timestamp size at the beginning of your script. If you don't specify the criteria, it will use the default, typically just timestamp and size.
        Chris K Scooter Software

        Comment

        • yakash
          Visitor
          • Oct 2004
          • 5

          #5
          Re: Script Output to HTML

          Default criteria is fine with me. I added Select all command. Still, I can't get the script file to generate html file. No errors in the log file. Am stuck!

          # Beyond Compare Script To Scan Windows Directory For Changes.
          #

          ################################################## ################################################## #

          # Turn logging on

          log verbose "C:\Beyond Compare\Windows-log.txt"


          # Load the base folders


          load "C:\Beyond Compare\Windows.bcss" "C:\Windows"

          expand all

          Select all

          folder-report layout:side-by-side options:display-mismatches output-to:C:\Beyond Compare\Windows-results.html output-options:html-color


          snapshot save-version rt output:"C:\Beyond Compare\Windows.bcss"

          ################################################## ################################################## ###

          Comment

          • Chris
            Team Scooter
            • Oct 2007
            • 5538

            #6
            Re: Script Output to HTML

            I missed it the first time, but your "C:\Beyond Compare\Windows-results.html" needs to be in quotes because of the space in the folder name. Then it should generate the report.

            If you aren't going to compare version information, the snapshot command will run much faster without that option.
            Chris K Scooter Software

            Comment

            • yakash
              Visitor
              • Oct 2004
              • 5

              #7
              Re: Script Output to HTML

              Thanks. That worked. Is there a way to create this html file with small font sizes (For e.g. Header of the html file - font size 9 instead of 11 and body of the html file - font size 8 instead of 10?

              Comment

              • Chris
                Team Scooter
                • Oct 2007
                • 5538

                #8
                Re: Script Output to HTML

                You can change the formatting of the html report by using the the html-custom=<filename> option instead of html-color. The <filename> is a path or url to a custom stylesheet for the report.
                Chris K Scooter Software

                Comment

                • yakash
                  Visitor
                  • Oct 2004
                  • 5

                  #9
                  Re: Script Output to HTML

                  Do you have a template for custom style sheet??

                  Comment

                  • Chris
                    Team Scooter
                    • Oct 2007
                    • 5538

                    #10
                    Re: Script Output to HTML

                    I put an example template up on our website.

                    You can download it from:
                    http://www.scootersoftware.com/stylesheetsample.css

                    If you need help customizing it, please let us know.
                    Chris K Scooter Software

                    Comment

                    • receptive
                      New User
                      • Aug 2006
                      • 2

                      #11
                      Re: Script Output to HTML

                      Hi Chris,

                      I'm new to BC and really enjoyed using this product so far.

                      I have taken a look at the style sheet and would like some help on html formats for csv file comparisons.

                      Currently, I'm usig a side by side layout and I would like to see the data align in columns. The rows are correctly aligned and created but the columns are displayed using commas.

                      It would be wonderful if the data can be displayed in tables using style sheets. Currently I'm making the tables manually and it has been a pain and I would greatly appreciate your help in this matter if possible.

                      Thanks
                      Li

                      Comment

                      • Chris
                        Team Scooter
                        • Oct 2007
                        • 5538

                        #12
                        Re: Script Output to HTML

                        There isn't a way to generate a report of CSV files from the File Viewer that will list each comma separated field as a column in an HTML table. I also don't think it is possible to do it only with a custom style sheet.

                        If you use the Data Viewer plug-in, you can use the File|Data Comparison Report command to generate a csv file showing the differences. You might be able to import the csv file into Excel and convert it into HTML from Excel.
                        Chris K Scooter Software

                        Comment

                        • receptive
                          New User
                          • Aug 2006
                          • 2

                          #13
                          Re: Script Output to HTML

                          Great thanks Chris!

                          Now the only problem is we're using a trail version. We are in the process of testing BC to our needs and my manager hasnt decided to purchase this product yet.

                          Would it be possible to send me some examples of the result csv file showing differences after using Data Viewer? I want to see how it actually looks like.

                          Thanks a bunch.

                          Comment

                          • Chris
                            Team Scooter
                            • Oct 2007
                            • 5538

                            #14
                            Re: Script Output to HTML

                            Here's an example of the Data Viewer's report output.

                            Two files to compare

                            original.csv:
                            "smith","123"
                            "kennedy","456"

                            modified.csv:
                            "smith","123"
                            "added","111"
                            "kennedy","457"

                            And the output of a data comparison report to a file.
                            Output.csv:
                            "File1","File2","Column","File1 Row","File1 Data","File2 Row","File2 Data"
                            "C:\w\original.csv","C:\w\modified.csv","A",,,1,"a dded"
                            "C:\w\original.csv","C:\w\modified.csv","B",,,1,11 1
                            "C:\w\original.csv","C:\w\modified.csv","B",1,456, 2,457
                            Chris K Scooter Software

                            Comment

                            Working...