Question about common currency warnings at start up...

Dale Alspach alspach at math.okstate.edu
Tue Nov 8 23:43:52 EST 2005


There is a reported bug:

Bug 165719: log replay loses currency info 

I had this same problem over a year ago. I wrote a perl script to fix it.

Dale Alspach

Use at your own risk:

 #!/usr/bin/perl
open(gncdata,"<infile");
my @data = <gncdata>;
close(gncdata);
$alldata=join('<end>', at data);
open(gncdata,">outfile");
@transaction=split(/<gnc:transaction version=\"2.0.0\">\n/,$alldata);
for ($n=0;$n<scalar(@transaction);$n++) {
                                                                                
$transaction[$n]=~s/<\/trn:id>\n<end> *<trn:num>/<\/trn:id>\n<end>
<trn:currency>\n<end>    <cmdty:space>ISO4217<\/cmdty:space>\n<end>
<cmdty:id>USD<\/cmdty:id>\n<end>  <\/trn:currency>\n<end> <trn:num>/s;
$transaction[$n]=~s/<\/trn:id>\n<end> *<trn:date-posted>/<\/trn:id>\n<end>
<trn:currency>\n<end>    <cmdty:space>ISO4217<\/cmdty:space>\n<end>
<cmdty:id>USD<\/cmdty:id>\n<end>  <\/trn:currency>\n<end>
<trn:date-posted>/s;
print gncdata "<gnc:transaction version=\"2.0.0\">\n";
@lines = split /<end>/, $transaction[$n];
for (@lines){
print gncdata $_;
}
}
close(gncdata);



More information about the gnucash-user mailing list