import question, other newbie things

Wesley Sheldahl wsheldahl@qx.net
Tue, 3 Apr 2001 23:24:10 -0400


To extend the life of this script a few years, try this to fix up dates
between 00 and 09 instead of just up to 01:

$date =~ s/(.*)['\/][ 0]([0-9])/$1\/200$2/;

It might look less readable, but it should be able to replace the following
snippet and still handle all the same cases.  :-)
>     ## here we have the whole record, do the massaging.
> 
>     if (($date =~ /(.*)\/00$/) ||	# Y2K
> 	($date =~ /(.*)\/ 0$/) ||
> 	($date =~ /(.*)\'00$/) ||
> 	($date =~ /(.*)\' 0$/)) {
> 	$date = "$1/2000";
>     }
>     if (($date =~ /(.*)\/01$/) ||	# Y2K++
> 	($date =~ /(.*)\/ 1$/) ||
> 	($date =~ /(.*)\'01$/) ||
> 	($date =~ /(.*)\' 1$/)) {
> 	$date = "$1/2001";
>     }
On 2001.03.28 20:37 Gregory T. Sullivan wrote:
> For many years, I've been downloading .QIF files from my bank,
> processing them with a simple PERL script to categorize them, and then
> importing the QIF files into Quicken.  One of the many reasons I'm
> excited about using gnucash is that I presumably can now write the
> processing code in a decent language like Scheme.  For the time being,
> though, I still use the PERL script, and I've appended parts of it.
> 
> Caveats: I'm no great PERL programmer, and the script does no error
> checking, but it gets the job done.
> 
> -- 
> Greg      gregs@ai.mit.edu (617)253-5807
> Sullivan  http://www.ai.mit.edu/~gregs/
> --

-- 
Wes Sheldahl
wsheldahl@qx.net