A User's view of Hledger

Learning about hledger

Small changes to csv import to hledger

I made some small improvements to my ELisp code to take csv files from my mutual fund and generate hledger transactions in plain text format.

First, I made the main/wrapper function interactive. This makes it easier to call from inside my hledger data file. That is, I don’t have to write the actual function and execute it. I just use M-x and select my function to run.

Because I call the function from inside my hledger data file, the output — the transactions in proper hledger format — are right where I need them. Assuming, of course, that I didn’t make a mistake and run the command when my cursor was in the middle of a transaction or other text.

Previously, when I called the function programatically, I had to write out the filename and directory. I quickly got tired of that, so I hard coded the filename and directory in my ELisp code. This saves time.

The potential disadvantage of this is that each time I import the csv file from my mutual fund, I have to make sure I name the file correctly and that it is in the correct directory. But it’s good enough for now.