Man besorge sich lua (eine Programmiersprache) und für dieses die Bibliotheken „LuaXML“ und „gzip“ (wer mehr Informationen/ Hilfe benötig, wende sich gerne an mich) .
Hiermit können wir die in gnucash erzeugte Kontenhierachie relativ simpel in eine Tabelle überführen.
-- load XML Library and gzip
local m = require"LuaXML"
local g = require"gzip"
local iolib = require"io"
local output = io.open("AcctDim.xls", "w")
-- open gzip'ed file and load contents to ram
local f = gzip.open([[E:gnucashHaushaltskasse.gnucash]])
local xmlString = f:read("*a")
-- transform xml into lua table
local xfile = xml.eval(xmlString)
-- find the book element
local book = xml.find(xfile,"gnc:book")
-- print output file header
output:write("AccountnametIDtParentn")
-- print dimension info
for k, v in pairs(book) do
if v[0] == "gnc:account" then
for i, j in pairs(v) do
if j[0] == "act:id" then
output:write(j[1] .. "t")
elseif j[0] == "act:name" then
output:write(j[1] .. "t")
elseif j[0] == "act:parent" then
output:write(j[1] .. "t")
end
end
output:write("n")
end
end
output:close()