From 28df0d583cbf101e3e303971be9370dcebdff0a3 Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Mon, 23 Jul 2001 20:26:47 +0000 Subject: [PATCH] simple perl script to autogen large gnucash data files git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4975 57a11ea4-9604-0410-9ed3-97b8803252fd --- doc/examples/create-bogus-data.pl | 72 +++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100755 doc/examples/create-bogus-data.pl diff --git a/doc/examples/create-bogus-data.pl b/doc/examples/create-bogus-data.pl new file mode 100755 index 0000000000..d2269dda14 --- /dev/null +++ b/doc/examples/create-bogus-data.pl @@ -0,0 +1,72 @@ +#! /usr/bin/env perl +# +# create-bogus-data.pl +# +# Create a lot of 'fake' transactions, handy for generating +# large datasets for performance testing. +# +# currently, very hacked up, uses hard-wired accounts +# from the "txnreport.xac" test file + + +$ntrans = 3000; + +$fromacct="bbf5756d8cada56c1245c49a1a5627a7"; +$toacct="ef2b8b63e7be48360da608038b65f5bf"; + +sub getguid +{ + local $guid; + open (UID, "uuidgen |"); + $guid = ; + chop $guid; + $guid =~ s/-//g; + return ($guid); +} + +for ($i=0; $i<$ntrans; $i++) +{ + $trnguid = &getguid; + $spaguid = &getguid; + $spbguid = &getguid; + + $val = 10001 + $i; + + $hr = $i % 24; + $dy = (($i-$hr)/24) %26 + 1; + $mon = ($i - ($i%625))/625 + 9; + $mon = $mon %12 +1; + + $datep = join ('', "2000-", $mon, "-", $dy, " ", $hr, ":26:30 -0400"); + + print " + + $trnguid + + $datep + + + 2000-09-08 15:26:30 -0400 + 598529000 + + Cap. gain (short) + + + $spaguid + n + $val/100 + $val/100 + $fromacct + + + $spbguid + n + -$val/100 + -$val/100 + $toacct + + +\n"; + + +}