vanishing .xac and .log files
hendrik at topoi.pooq.com
hendrik at topoi.pooq.com
Fri Aug 17 17:43:00 EDT 2007
On Fri, Aug 17, 2007 at 09:47:32AM -0400, Josh Sled wrote:
> hendrik at topoi.pooq.com writes:
> > Now I need a tool that will tell me all the differences between
> > reconciled splits between those two .xac files. Anyone know of one?
> > output from diff itself (after gunzipping, of course) contains too much
> > irrelevant junk, and consists of uncontexted fragments of
> > transactions.
>
> (I've seen you on another couple of mailing lists, so I know you're a good
> bit technical...)
>
> I'd extract the relevant Splits via XSLT, though not to XML .. just
> line-oriented plain text. Probably something like:
>
> Split1GUID Split1Date Split1Desc Split1Acct Split1Amt
> Split2GUID Split2Date Split2Desc Split2Acct Split2Amt
>
> Then, /usr/bin/sort it so the splits are ordered by guid. Then do the
> line-oriented diff.
>
> Something like...
>
> <xsl:output method="text"/>
> <xsl:template match="//trn:split[split:reconciled-state='y']">
> <xsl:value-of select="./split:id/text()"/><xsl:text> </xsl:text>
> <xsl:value-of select="./split:memo/text()"/><xsl:text> </xsl:text>
> <!-- ... -->
> </xsl:template>
>
> Should do the trick, I think.
Thanks, I should really learn xsl/xslt sometime.
But by the time I got your reply, I had hacked together another
way. Sleeping on a problem does wonders!
I took an old program I had debugged into existence a few years ago that
prints all the transactions sorted by account tree in a somewhat
readable form -- just plain text, one per line.
I modified it so it would not filter output by year, but would instead
pay attention only to reconciled splits.
After maiking these changes, it didn't work, so I inserted some trace
statemente to see what it was doing instead. I never got it to work
(programs debugged into existence are not of the best), but I realised
that the trace output I was getting was what I really needed! So I took
the trace output files from processing the two gunzipped .xac files,
sorted them, and diffed the results.
Eureka!
-- hendrik
More information about the gnucash-user
mailing list