Announcement

Collapse
No announcement yet.

Need XML file for Do-It-Yourself excel diff

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

  • Need XML file for Do-It-Yourself excel diff

    Hi,

    I noticed that there is a excel comparison tool on the wishlist. However I would need it now (yesterday)...

    You have MS Word diff tool, maybe something similar could be used for excel? I have at the moment a perl script to save one excel sheet as MSDOS text i.e. very similar to the Wond
    comparision tool. But what to do with the XML file? I couldn't find any docs about that format.

    After I'd have the XML file setup correctly and be able to compare rough conversions of excel files, then I could make the perl script to do what I really want to:

    1) one sheet at a time
    - Show sheet title
    - Show all visible text (no hidden rows/columns)
    - Show all formulas (no hidden rows/columns)
    2) Wordbook VBA scripts

    Cheers,

    --jouni

  • #2
    Re: Need XML file for Do-It-Yourself excel diff

    You can just manually edit a rule to add conversion using a perl script:
    <ul type="square">[*]In the Tools menu of the File Viewer, choose Edit Current Rules....[*]Switch to the Conversion page and change the Conversion Type to External Program.[*]In Run when loading, enter the appropriate command line (ex. perl MyScript.pl %s %t). %s is the source filename and %t is the target filename.[/list]
    For an example of a rule that uses a perl script, download the Sorted Ini Files rule at http://www.scootersoftware.com/morerules
    It includes perl.exe and perl58.dll as well as the script, IniSort.pl.
    Erik Scooter Software

    Comment


    • #3
      Re: Need XML file for Do-It-Yourself excel diff

      Thanx for sample, I managed to make it work a little bit! There is something strange in P4 (perforce version control), which we are using, but that should have nothing to do with Beyond Compare or my script experiments.

      Hmph, is there any way to attach documents here? Nope? Well, I'll Copy&Paste them here in case there's general interest. Please note that this perl script saves the first sheet as txt, nothing else. I just wanted to know whether I can use BC for this and now that's it's proven, I can continue making a more useful perl script.

      Btw I still have no idea what the xml file does, but it seems to work

      xls2txt.xml
      ===========
      <bc_settings>
      <rules>
      <list name="MS Excel simple">
      <str_val name="RulesClass" value="TFreeForm1Rules"/>
      <str_val name="FileTypes" value="*.xls"/>
      <str_val name="Version" value="###"/>
      <int_val name="Tab" value="8"/>
      <int_val name="Speed" value="6"/>
      <int_val name="CodePage" value="0"/>
      <int_val name="Case" value="1"/>
      <int_val name="Convert" value="3"/>
      <str_val name="InCvtCmd" value="perl xls2txt.pl %s %t"/>
      <int_val name="CvtRO" value="1"/>
      <str_val name="WS" value="-"/>
      <list name="Classify"/>
      </list>
      </rules>
      </bc_settings>

      xml2txt.pl
      ==========
      #!/usr/bin/perl -w

      use strict;
      use Win32::OLE::Const 'Microsoft Excel';
      $Win32::OLE::Warn = 3;

      if ((scalar(@ARGV)) != 2)
      {
      print "Usage: $0 infile outfile\n";
      exit;
      }

      my $Excel = Win32::OLE->new('Excel.Application', 'Quit');
      $Excel->{DisplayAlerts} = 0; # don't ask, just overwrite

      my $Book = $Excel->Workbooks->Open($ARGV[0]);
      $Book->Worksheets(1)->SaveAs($ARGV[1],xlTextMSDOS);
      $Book->Close(0);

      # end of file

      Comment


      • #4
        Re: Need XML file for Do-It-Yourself excel diff

        You can export any File Viewer rules as an xml file. You can import the xml file to add rules that others have created.

        If you develop a rule that might be useful to others, e-mail it to us at support@scootersoftware.com.
        Erik Scooter Software

        Comment

        Working...
        X