This is exactly what I do in this situation. First I fix the importer and 
the testcases.
Then, separately, I create a mutation on the existing ledger to match it. 
Usually this involves some REGEX :)
Tips:
  Use source control (hg). This way you can a) see the diffs you've created 
, b) rewind to a good state if necessary
  Use Sublime or another editor that allows Find and Replace with 
multi-line regular expressions.

On Wednesday, August 19, 2020 at 8:21:37 PM UTC-7 [email protected] wrote:

> No idea.
> I keep all my imported sources in a repo but I hardly ever rerun on them.
> If you keep you input file really neat you might be able to use a visual 
> diff tool (e.g. xxdiff) and select the new bits you want.
> More sophisticated than that you could write a script that attempts to map 
> the new imported transactions to the original ones in the input and and 
> replace.
>
>
> On Mon, Aug 17, 2020 at 4:15 PM Mark <[email protected]> wrote:
>
>> Hi, all
>>
>> I am wondering if there is a convenient way to retroactively apply 
>> changes made in Importers to current beancount journal. For example, if I 
>> created a new category
>> for certain transaction in an Importer, I would like to also change 
>> categories of all the previous transactions in the journal. 
>>
>> One solution (hack) I can imagine could be this:
>> 1. set up a temporary Importer
>> 2. use `bean-extract -e my_journal.bean ... ` and map the change
>>     over entries that should be modified in `existing_entries` defined
>>     in `def extract(self, file, existing_entires=None)`. Return 
>> `existing_entries`. 
>> 3. Uncomment all the lines in the output
>>
>> Thanks ahead, and thanks for Martin for this amazing software!
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Beancount" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/beancount/c9c8f157-2d4d-489f-bf2e-1a321ee33993n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/beancount/c9c8f157-2d4d-489f-bf2e-1a321ee33993n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/9b48cbe8-1971-463e-86f2-2e885cee4c13n%40googlegroups.com.

Reply via email to