Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

4 Answers 4

up vote 2 down vote accepted

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

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

share|improve this answer

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.

share|improve this answer
    
There are a few problems with that. First, it doesn't produce OFX files as output. Second, it can only append, not merge. –  Ryan Thompson Aug 24 '10 at 5:40

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

share|improve this answer
    
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. –  Ryan Thompson Aug 29 '10 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 Aug 29 '10 at 7:34

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.

share|improve this answer
    
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. –  Marcin Aug 24 '10 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. –  Marcin Aug 24 '10 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. –  Velociraptors Aug 24 '10 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. –  Marcin Aug 24 '10 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. –  Ryan Thompson Aug 24 '10 at 5:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.