On 5/8/23 13:05 +0300, David T. wrote:

It's a wiki, so you could put it in. You'd get to decide where that would best live, too.

Perhaps sometime during the week I'll add something. With the obvious
warnings about making backups and the possibility of making a mess for
one's self.

FWIW, my method for doing this is to save the file as an SQLite
file, open the result in a DB reader, locate the appropriate table
there, and execute the change globally. Then I reopen the file in
GnuCash and save it back to xml.

It feels easier to me to do it this way and it doesn't take much time.

SQLite queries may be a bit more than some users are willing to try. But I can see where it would be easy for those comfortable with it. Same reason xmlstarlet would be simple for those familiar with it.

If I unpacked the .gnucash file to foobar.gnucash, this command would change the quote source globally.

xmlstarlet ed --inplace -u '/gnc-v2/gnc:book/gnc:commodity/cmdty:quote_source["yahoo_json"]' -v 'alphavantage' foobar.gnucash

One can also selectively change the quote source for a specific namespace. This command would change the quote source for just the NASDAQ securities.

xmlstarlet ed --inplace -u '/gnc-v2/gnc:book/gnc:commodity[cmdty:space="NASDAQ"]/cmdty:quote_source["yahoo_json"]' -v 'alphavantage' foobar.gnucash

- Bruce S.
_______________________________________________
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.

Reply via email to