Inline below. On Wed, Oct 03, 2012 at 04:27:09PM +0100, Toby Gee wrote: > Sorry - I wrote this two days ago and it's been held up in moderation, I > guess. > > Since then I tried icsv2ledger, and managed to do most of the below > (I'm sure csv2ledger can also do it, of course), so I now have two > slightly different questions, one hopefully almost trivial. > > - is there an easy way in all of this (perhaps in Ledger itself?) to > - change the sign of all of the transactions for some account? One > - of my credit cards uses the opposite sign convention to all my > - other accounts.
CSV2Ledger has a negate option you can set based on input filename or on the command line. > - how do people deal with avoiding duplicates? Several of these > - importing options produce MD5 hashes from the original line in the > - csv file, which should presumably make this straightforward. CSV2Ledger takes an md5sum of the original csv line and stores both with the generated txn as metadata. Those md5sums are used to dedup new data. There's even a caching option for working with many large files to speed up processing. I rely heavily on this, because when I download my credit card data it always overlaps. > With my new icsv2ledger setup, each account now produces a ledger > file, and I then manually copy it into my main accounts file. Of > course, I could write a script to append it to the main accounts > file, but is there a better way to import the transactions, avoiding > any duplicates, to deal with csv files with overlapping date ranges? I use the concept of a queue file (Queue.dat) that all my imports goto. Once they are assigned a primary expense report, they are moved by a separate script to an expense report specific file and that is added to my include list. > On 1 Oct 2012, at 11:01, Toby Gee <[email protected]> wrote: > > > > > > > So - is there a way to do this, either by the importing program > > analysing the accounts.dat file, or by manually setting up some > > rules for converting from payee to liability? CSV2Ledger supports several rules layers: - Preprocess: Arbitrary regexp replacements to perform on the CSV data prior to converting. Useful for payee renaming. - File level: Sets command line arguments by filename (ie: import columns, negation, fuzzy date matching, receipt file tagging parameters, default accounts, etc) - Account matching by payee: Using a regexp by payee, assign source and destination accounts. > > > > I'm wondering if CSV2Ledger can do this, based on the above > > remark: > > > > "Dynamic renaming based on payee, account matching, even file > > matching using a YAML format." > > > > However I'm not sure how this works in practice - do I just need > > to read the comments in the perl file, learn what YAML is etc? > > > Enjoy! ------------------------------------------------------------------ Russell Adams [email protected] PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3
