Splitting into months

In this example you will take a sample input file, run it through the QifCon to remove any transactions that do not match the specified month. Then by altering the matching month you can re-run qifcon to split out the next month, and so on.

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  version="1.0">
  <xsl:output method="xml" version="1.0" encoding="ISO-8859-1" indent="yes" />

  <!-- Remove anything not in this month -->
  <xsl:template match="transactionRecord">
    <xsl:if test="contains(child::date/text(),'/2/94')">
      <xsl:copy>
        <xsl:apply-templates />
      </xsl:copy>
    </xsl:if>
  </xsl:template>

  <!-- Copy Unmatched Attributes and Nodes As Is -->
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()" />
    </xsl:copy>
  </xsl:template>
</xsl:stylesheet>

Running

qifcon --input examples/split_into_months/split.qif --output output.qif examples/split_into_months/split_02_1994.xsl quicken.xsl

Now open the output.qif file in your favourite editor. Compare it to the input file split.qif . You should notice that the only transactions included are the ones for the specified month of "02/94".