Diffing two account files

AC gnucash at acarver.net
Thu Aug 13 17:33:30 EDT 2015


On 2015-08-13 12:01, Mike or Penny Novack wrote:
> 
>> GnuCash can't do that, but if you're using an XML format file to save
>> your GnuCash data, it's just text file.  I sometimes use a text file
>> compare program to find out what changed between two versions.  The
>> file may be big, so whatever program you use needs to be able to diff
>> large files.  I usually use BBEdit, but it's a Mac program and not
>> free so may not be of any use to you.
>> _______________________________________________ 
>  The file format doesn't matter, a byte by byte compare program can
> compare any. I used to use ones with hex output, but then I was usually
> comparing files of mixed data content.
> 
> Such general purpose compares are "utilities", not properly part of any
> particular application (one where the difference output was being
> formatted, might be part of an application).
> 
> If you are using a 'nix operating system, your shell language plus
> library of 'nix utilities can do the job. If you are Mac user, well have
> you ever used the command line? (under the hood, a form of BSD unix)
>


The problem is that the operation I need isn't a byte comparison, it was
a record comparison which, for an XML file, really boils down to a
line-by-line comparison since it has to account for context.  If records
are out of order then the typical usage of diff will attempt to
resynchronize all the while emitting a lot of false positives.  If
there's enough of those then the real, singular missing record will be
buried in a bunch of noise.

Diff is a pretty smart tool but XML databases are just a bit beyond its
capabilities especially if they are not guaranteed to be consistent in
their data storage order.


More information about the gnucash-user mailing list