Search and Replace

R. Victor Klassen rvklassen at gmail.com
Sun Jan 3 20:16:40 EST 2016


I would like to elevate the question to something more along the line of a feature request.

The scenario is as follows:

During the high season, we have 5-6 invoices per week, largely containing the same items, but different quantities, and sometimes different prices.  
Occasionally auto-fill doesn’t happen - for what reason, I don’t know.   It is usually in such an instance that an item may have the wrong account associated with it.
But this means that accounts can from time to time get wrong.

And then for the next - oh, 4-6 weeks, this is applied to every invoice with that item, thanks to autofill.  I notice when one of the income accounts is surprisingly low or high (usually low, as I’m less likely to be suspicious if it is high).

Here is where a search and replace would be wonderful.   Find all occurrences of XXX in the description field of all invoices between date D1M1YYY1 and date D2M2YYY2 and change the account to AAA if it is not already.   Possibly with a confirm requested on each occurrence.

As it is I get to go through account BBB (to which XXX had been accidentally assigned), find all the transactions with XXX in the description, to find the invoice numbers, look up the invoices by number, UNPOST them, thereby losing the payment link, re-assign the account in the appropriate line of the invoice, and re-post.   And probably re-associate the payment.

Doing this by editing the XML doesn’t work, since too much is just links by GUID, rather than being explicitly in one place.   I don’t know how hard it would be to do it by altering the sql database, as I don’t have any experience with scripting SQL.

On Jan 3, 2016, at 7:27 PM, David Carlson <david.carlson.417 at gmail.com> wrote:

> On 1/3/2016 3:33 AM, Colin Law wrote:
>> On 2 January 2016 at 16:38, nevyoung <nevyoung at gmail.com> wrote:
>>> Hi - Is there a search and replace function?
>>> I used Quicken for many years but started using Gnucash a year ago. I have
>>> been very disappointed in its ability to bulk search and replace Description
>>> names that were entered incorrectly or need to be changed for some or other
>>> reason.
>> I think that if you saved the file as non-compressed xml then you
>> could probably use a text editor to do the find and replace.
>> Obviously save a backup of the file first just in case it messed it
>> up.  Someone more knowledgeable will no doubt put me right if that is
>> not correct.
>> 
>> Colin
>> _______________________________________________
>> 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.
>> .
>> 
> 
> 
> I think there would be a few caveats.  One would be to limit searches to text contents not crossing any XML tag boundaries. Another might be that you need to use a computer with 64 bit addressing if the file is very large.
> _______________________________________________
> 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.




More information about the gnucash-user mailing list