Announcement

Collapse
No announcement yet.

Newbe Simple File Compare

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

  • Newbe Simple File Compare

    Hi, We are running BC 2.5.

    An automated script runs on our servers to gather Windows services that are running and set to Auot startup, another is run after a powerdown and these 2 files need to be comapred for differances.
    So far the 2 fdiles are .html files, BC GUI with the html-to-txt plugin works good but i need a simple command line script which will compare the 2 files and display the differances to a 3rd file without invoking the BC GUI.

    I have looked at the BC help files but still can't get it to do anything.

    Help!!!!


    Cheers

    Rob

  • #2
    This is the command i am trying to run...

    bc2 file1.txt file2.txt \file-report layout:side-by-side options:display-mismatches \title:file3.txt output-to:"file3.txt"

    Comment


    • #3
      Heres my newest attempt...

      Batch file...
      bc2.exe @commands.txt "file1.txt" "file2.txt"

      Script file...
      load test
      expand all
      select files
      file-report layout:side-by-side title:"output" options:display-mismatches output- to:"file-diff-report.html" output-options:html-color %1 %2

      The output html file only displays the file1.txt contents, it doesn't seem to do a comparison.

      Comment


      • #4
        Right, this works as a proof of concept with text files...

        script file...

        file-report layout:side-by-side options:display-mismatches output-to:"E:\scripts\service check\test\file-diff-report.html" output-options:html-color "E:\scripts\service check\test\file1.txt" "E:\scripts\service check\test\file2.txt"

        Batch file...

        bc2.exe @commands.txt "E:\scripts\service check\test\file1.txt" "E:\scripts\service check\test\file2.txt"

        I now can't get it to read .html files and not the source code. The GUI can do it with the HTML-TXT plugin, how do i use it within the command line?

        Comment


        • #5
          Hello,

          Your script will use the default file format associated with the specific file type. This will be the top most installed file format in the Tools menu -> File Formats dialog associated with *.html.

          Move your HTML to Text rule to the top of the list (above HTML or other *.html rules). Then when you generate the file-report, it will use this rule.

          Your script file uses defined names. If you want to use the parameters, you can use %1 and %2 to refer to the parameters (in this case your file names).

          Are you executing the script as the same Windows User account as the graphical interface? Options and File Formats are stored on a User by User basis, so you will need to run as the same user to use the same settings.
          Aaron P Scooter Software

          Comment


          • #6
            Im running the script on a machine with only the bc2.exe on and the script and the GUI will not be accessed.

            Comment


            • #7
              When the HTML to Text rule is installed, it should be at the top of the list and used automatically, but it would be good to fire up the GUI to double check. The GUI is also a useful tool in troubleshooting if the conversion is working correctly and displaying the information as you expect in the File Viewer. Since your script looks ok, this is the next step necessary to figure out why it isn't generating the report you expect. If it isn't displaying correctly in the File Viewer, then the script won't be able to work either, and would point to a configuration problem.
              Aaron P Scooter Software

              Comment

              Working...
              X