stant / mdcsvimporter2015

GNU Lesser General Public License v3.0
13 stars 5 forks source link

mdcsvimporter2015

Moneydance plug-in to import transactions from CSV files. You can define, simply, on a screen, any number of 'Custom Readers' yourself, one for each Account file.

Latest version: only from here - version right in Money Dance is: 15.7.7 at this time, so if you want the latest, get it from here. Remove old version. Restart. Install via 'Add From File'.

The plug-in is still considered BETA, however, it works well for people who have tried it.

It is distributed under GNU LGPL. Among other things this means that it is free, but that the authors cannot take any responsibility for you using this code.

** Quick Usage: This is a top down window process. I might look at getting rid of 'Date Format', but when I have time. You have to define a reader first of all and tell it how to match filenames. An improvement I plan to make is to tell people if they do not have one and that they need to create one first.

** How to Set Up 'Filename Matcher': (you match with a regex, regular expression, look that up) Here are some examples:

.*\.(csv|CSV) .* means match anything, then it has to end with a dot "\." and either csv or CSV (this|that) matches "this" or "that"

download.*\.(csv|CSV) almost the same but it has to begin with "download" then anything, then .csv or .CSV

for VISA: Transactions_\d+_\d+.csv matches Transactions_(1 or more numbers)_(1 or more numbers).csv like: Transactions_20170325_214425.csv

for Discover: (DFS-|Discover).*\.(csv|CSV) matches DFS- or Discover, then anything, then .csv or .CSV like DFS-whatever.csv or Discover.1234.CSV

** regex field parsing changed in v21 to hopefully give more flexibility. you need to use "named capture groups", as in:

value = what string you want to pull out for the field value. rest = is left over line to parse next.

"?(?<value>.*?)"?(?:[,]|\Z)(?<rest>(.*|\Z))        will handle basic csv parsing

"(?<value>.*?)"(?:[,]|\Z)(?<rest>(.*|\Z))       I had to do this to get amount within "123,456.78"

"?(?<value>.*?)"?(?:[,]|\Z)     final list for "ignore rest"

(?:CHECK[ ](?<value>\d*)|(.{0,0}))(?<rest>.*)   This actually adds an extra column. 

it will parse 
04/10/2018,CHECK 0001234,,"($530.46)","$123"
04/04/2018,Insurance,PREM,"($467.30)","$5"

into
04/10/2018,1234,         ,    ,"($530.46)","$123"
04/04/2018,    ,Insurance,PREM,"($467.30)","$5"

How it parses a whole line:

if you have this line:
01/14/2018,check 3000,My Store,$123.40,whatever

it will parse like this:
get value = 01/14/2018
rest = check 3000,My Store,$123.40,whatever

get value = check 3000
rest = My Store,$123.40,whatever

get value = My Store
rest = $123.40,whatever

get value = $123.40
rest = whatever

get value = whatever
rest =