batch edit security editor

brad bradhaack at fastmail.us
Wed Nov 8 16:26:21 EST 2017


Since it sounds like alphavantage is going to be slower than yahoo and I 
have quite a few securities that I don't need to get quotes for anymore 
I turned off 'get online quotes' for everything with a script edit of 
the xml file.   Then I can update the relatively few securities I need 
with quote source 'alphavantage'.

!!!  Warning unapproved and possibly dangerous (but it worked for me). !!!

The heart of this is the sed command.  This was my workflow from a 
unix/linux shell:

close gnucash

If your gnucash file is called file.gnucash

cd to the directory where file.gnucash exists

cp file.gnucash file.gnucash.bak  # back it up in case things go wrong

mkdir Temp

cd Temp

cp ../file.gnucash file.gnucash.gz   # the gnucash file is compressed

gunzip file.gnucash.gz  # because gunzip likes the suffix to be there

sed 's;<cmdty:get_quotes/>;;' file.gnucash > temp

mv temp file.gnucash

gzip file.gnucash

mv file.gnucash.gz ../file.gnucash






More information about the gnucash-user mailing list