Delete things from template

Dustin Henning The00Dustin at gmx.net
Fri Dec 21 08:51:45 EST 2012


-----Original Message-----
From: gnucash-user-bounces+the00dustin=gmx.net at gnucash.org
[mailto:gnucash-user-bounces+the00dustin=gmx.net at gnucash.org] On Behalf Of
David Carlson
Sent: Thursday, December 20, 2012 23:40
To: gnucash-user at gnucash.org
Subject: Re: Delete things from template

On 12/20/2012 9:23 PM, John Ralls wrote:
> On Dec 20, 2012, at 4:43 PM, Chris Henderson <henders254 at gmail.com> wrote:
>
>> I am using gnucash version 2.4.11 on os x mountain lion.
>>
>> My mistake I have added a wrong stock detail in the template under 
>> tools - security editor. Now every time I try to get an online quote 
>> it gives an error saying unable to retrieve. I know that I can delete 
>> things from the template by editing the xml file (source:
>> http://gnucash.1415818.n4.nabble.com/setting-up-stock-non-us-exchange
>> -td4477753.html) but I am not sure which xml file to edit.
> Use Tools>Security Editor to either fix the symbol or delete the security
and try again.
>
> Regards,
> John Ralls
>
>
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> 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.
>
John

In Windows it is impossible to see an existing template type of stock or
commodity with Tools>Security Editor, thus it cannot be deleted.  That was
the reason for Derek's comment in that thread that you cited.
However, in version 2.4.11 it is still possible to unintentionally create a
security of type 'template'.

What was not made clear in that thread or elsewhere afaik was a detailed
list of steps explaining exactly which lines to delete from the XML file for
a person who does not have a style sheet or an intimate knowledge of either
XML code or the database structure.  I tried it once and it failed and I
never figured out why.  I had to find an editor that could handle huge
files, I settled on jEdit, but I also did not get very good at using that.
If you know of an easier editor to use, please help.

if someone ever tries to fix *Bug 555182*
<https://bugzilla.gnome.org/show_bug.cgi?id=555182> , I hope they include
code to purge existing instances from the database.

Thanks,

David C


> _______________________________________________

David,
	I'm not familiar with jedit, and I don't remember exactly what
needed deleted.  However, I will give you this all-open-source advice to use
AFTER you make a backup of your XML file...  XML files are plain text and
the file you need to edit is your main save file.  If it doesn't look like
plain text when you open it, it is compressed, and you need to change a
setting to save it uncompressed or extract it using something like 7-Zip.
If you go the latter route, save the edited file as .gnucash when you are
done, don't recompress it, as your next save will automatically be
compressed again anyway.  For editing, try notepad++, by default, it will
draw lines and stuff that make it easier to tell where you at even though
you haven't intimate knowledge.  You can search for the symbol you added,
and then delete one section at a time until it works.  For instance, if you
saw this after you found "yoursymbol":

<data=securities>
	<type=templates>
		<symbol=yoursymbol>
			multiple lines of data about your symbol
		</symbol>
	</type>
</data>

then you would start by deleting from "...<symbol..." through ".../symbol>".
Next, if you got an error, you would delete from "...templates>" through
".../type>".  Note that I made that whole structure up just to give you an
idea of how the structure is laid out (and the lines in Notepad++ wil make
this more visible), so this is a general idea example not an exactly what to
do example.  Good luck,

Dustin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6578 bytes
Desc: not available
URL: <http://lists.gnucash.org/pipermail/gnucash-user/attachments/20121221/ac8d7c9b/attachment.bin>


More information about the gnucash-user mailing list