2

OFX is an XML format for financial transaction history and many banks, including mine, provide the option to download your transaction data in this format. Unfortunately, they often force you to download a separate file for each statement. I would like to have one file for each of my accounts, rather than a bunch of file for each month.

So, are there any tools for taking multiple OFX files and merging them into one?

Edit

So, the first few answers have raised a few points of confusion. Let me clarify.

Not a text merge

OFX is an XML format. The XML has structure, and that structure is what needs to be merged. This is not a simple case of merging two text files.

Example: each OFX file has a field that specifies the ending balance, but you can't just stuff all the ending balances into the output file. You have to pick the most recent one. Ditto for the start date and end date.

Another example: each OFX file specifies an account (via account ID, bank ID, account type, etc.). It would be nice if the merge tool would refuse to merge OFX files unless they refer to the same account.

Duplicate transactions

Most importantly, if the OFX files have overlapping date ranges, then some transactions may exist in multiple input files. These duplicate transactions must be deduplicated.

For example, suppose there are two input files. The first input file covers the months January through August. The second one covers the months July through December of the same year. In this case, any transactions in July and August will appear in both input files. When merging, these transactions need to be detected as duplicates, and only one instance of each should appear in the output.

Note that this sort of de-duplication is one of the main problems with QIF, and one of the main reasons that OFX was designed.

4 Answers 4

3

Well, it turned out to be easiest to write it myself.

You can get it here: https://github.com/DarwinAwardWinner/ofxtoolkit

0

Take a look at this. It allows you to merge multiple OFX files into a single CSV (comma separated value) file. You can open the resulting file in any spreadsheet program like Excel or OpenOffice Calc.

1
  • There are a few problems with that. First, it doesn't produce OFX files as output. Second, it can only append, not merge. Commented Aug 24, 2010 at 5:40
0

You might be able to use the following procedure:

  1. Convert the OFX files to CSV format
  2. Concatenate the CSV files
  3. Convert the concatenated CSV file back to OFX format

The following two articles may help in executing this procedure:

How to Convert OFX or QIF to CSV File
How to Convert CSV to OFX or QIF File

2
  • A lot of the information from the original files would be lost in that process. Also, the Ofx converter that you reference seems to be designed for converting individual statements. I highly doubt that it would be able to handle duplicate transactions that could result from merging. Commented Aug 29, 2010 at 1:49
  • @Ryan Thompson: Duplication in the concatenated CSV file can be handled by one of the zillion existing free sort programs. I am sure that such programs exist for CSV, and can easily find you some if you are interested.
    – harrymc
    Commented Aug 29, 2010 at 7:34
-2

You didn't specify the OS, but WinMerge is the best diff/merge tool available for Windows. Since OFX is an XML format, it should be easy to merge the files.

8
  • I don't know if a direct file to file merge is the right solution here. Unless the OFX file format allows direct concatenation this might result in serious errors with XML tags.
    – mpaw
    Commented Aug 24, 2010 at 1:19
  • I just looked up the OFX documentation and each OFX file has <OFX> tag pairs that exist once per document, your solution would leave him with <OFX> tag pair for each document that is merged.
    – mpaw
    Commented Aug 24, 2010 at 1:21
  • Since the <OFX> tags are always identical, WinMerge won't duplicate them when merging the documents. A merge is based on what's different between files. I also assumed that the OP would take care when merging financial data, rather than blindly copying and pasting the whole document. Commented Aug 24, 2010 at 2:09
  • I don't deal with OFX files so I really can't be sure how just combining the XML data is going to work out. It's possible it could work without a problem, it's also possible it would blow up the world, j/k ;). The programmer in me wouldn't let me just combine the files like that and hope it works, but hey, that's just me.
    – mpaw
    Commented Aug 24, 2010 at 5:34
  • No, you can't just concatenate them, and this isn't a simple case of merging text. The XML has structure, and that structure is what needs to be merged. Example: each OFX file has a field that specifies the ending balance, but you can't just stuff all the ending balances into the output file. You have to pick the most recent one. Ditto for the start date and end date. Another example: each OFX file specifies an account (via account ID, bank ID, account type, etc.). It would be nice if the merge tool would refuse to merge OFX files unless they refer to the same account. Commented Aug 24, 2010 at 5:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .