#!/usr/local/bin/perl ####################################################################### # TSB2QIF: Mark J Cox 18 Nov 1999 www.awe.com/mark # # The Lloyds-TSB online service allows you to download a "PFM" file # as your statement, allowing import to things like Microsoft Money. # # I've found that my copy of Microsoft Money 2000 want's dates in UK # not US order. In addition the TSB site mixes the memo text with # the payee. This script changes the dates around and splits the memo # from the payee. # # perl tsb2qif.pl < tsbdownloaded.qif > tsbnew.qif # # Then import the file into your favourite program. I'd recommend using # MS Money 2000 as it will try to reconcile and match up entries in your # account as well as marking the cleared entries as electronic ("E"). # # Why doesn't the TSB output OFX format? Then it could handle statements # and balance the account! # # No warranty at all; Copy and use freely as long as this entire header # section stays intact; send me your updates! ####################################################################### # Version 1.00 18Nov99: first version while(<>) { if (m/^D(\d+)\/(\d+)\/(\d+)/) { print "D$2/$1/$3\n"; } elsif (m/^P/) { $left = substr($_,0,19); $right = substr($_,21); print "$left\n"; print "M$right" if $right; } else { print $_; } }