Changing Payee to Category

In this example you will take a sample input file, run it through the QifCon with a transformation file that converts a payee field with the text "Direct Debit RAA INSURANCE" into a category field "Insurance:Car".

The purpose of this example is to show how the input QIF file can be transformed and enhanced by manipulating the fields.

Transforming

payee_to_category.xsl:

<?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" />

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

  <!--
    Converts a payee field with the text "Direct Debit RAA INSURANCE"
    into a category field "Insurance:Car".
  -->
  <xsl:template match="payee[child::text()='Direct Debit RAA INSURANCE']">
    <category>Insurance:Car</category>
  </xsl:template>

</xsl:stylesheet>

Running

qifcon --input examples/payee_to_category/payee_to_category.qif --output output.qif examples/payee_to_category/payee_to_category.xsl quicken.xsl

Now open the output.qif file in your favourite editor. Compare it to the input file payee_to_category.qif .

The transaction no longer has a Payee field "PDirect Debit RAA INSURANCE" and has gained a Category field "LInsurance:Car".