Using Payee to Create Multiple Fields

In this example you will take a sample input file, run it through the QifCon with a transformation file that selects a payee field with the text "PCLink TRF to (055-999)-579290" (paying the lawn mower man) and creates multiple output fields:

  • MLawn Mowing (Memo)
  • LHousing:Garden (Category)

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

Transforming

payee_to_multiple.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 "PCLink TRF to (055-999)-579290"
    into a memo field "Lawn Mowing" and a category field "Housing:Garden".
  -->
  <xsl:template match="payee[child::text()='PCLink TRF to (055-999)-579290']">
    <memo>Lawn Mowing</memo>
    <category>Housing:Garden</category>
  </xsl:template>

</xsl:stylesheet>

Running

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

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

The transaction no longer has a Payee field "PCLink TRF to (055-999)-579290" and has gained a Category field "LHousing:Garden" and a Memo field "MLawn Mowing".