Contributed scripts



next up previous contents
Next: CBB Internals Up: CBB Check Book Balancer Previous: CBB Reference Manual

Contributed scripts

This section describes several scripts that are beyond the original scope of CBB, yet may be useful in managing your money. These scripts are installed in: $CBB_LIB_DIR/contrib

Investment Accounts

The script invest.pl is a simple hack to help me keep track of my investments. It accepts a simply formatted text file from stdin and writes a simple report to stdout. A sample input file could look like the following. Note: each field is separated by one or more tabs.

# Date          Description             Shares  Unit Price
#-----          -----------             ------  ----------
19960101        Beginning of 1996       10.000  25.00
19960201        Updated value           0.000   26.56
19960301        Purchase more shares    10.00   25.87
19960401        Updated value           0.000   26.04
19961216        St Cap Gain Reinvest    1.157   26.43
19961216        Lt Cap Gain Reinvest    1.220   26.43
19961216        Service Fee             -0.568  26.43

Executing the command: cat sample.inv | invest.pl would produce the following output:

                                        Price   Total
                                New     per     Shares  Total   Total
Date     Description            Shares  Share   Owned   Invstd  Value
-------- ---------------------- ------  ------  ------  ------  ------
19960101 Beginning of 1996      10.000  25.00   10.000  250.00  250.00
19960201 Updated value          0.000   26.56   10.000  250.00  265.60
19960301 Purchase more shares   10.000  25.87   20.000  508.70  517.40
19960401 Updated value          0.000   26.04   20.000  508.70  520.80
19961216 St Cap Gain Reinvest   1.157   26.43   21.157  539.28  559.18
19961216 Lt Cap Gain Reinvest   1.220   26.43   22.377  571.52  591.42
19961216 Service Fee            -0.568  26.43   21.809  556.51  576.41

Migrating from Previous Data File Formats

Please see section 2.5, page gif for an explanation of this script and its use.

Managing Recurring Transactions

Wouldn't you like your mortgage payment to entered automatically every month? Would you like to have some idea of how much money you will have in a month, six months, or a year? Then read on. This might be just what you need.

Recurring transactions which have been automatically inserted are denoted by placing a ``?'' in the ``cleared'' field. This is changed to a ``!'' when the transaction date has passed. (Note: this code is changed to a ``x'' when the transaction is cleared.)

Overview of the recur.pl script

The recur.pl script has two main sections.

  1. The first thing the script does is traverse the account looking for any transactions with a ``?'' in the cleared field. Of these transactions, those which have a date older than today's date will have their cleared field changed to a ``!''. Those transactions with a future date will be deleted. (They will be reinserted in the next step.)

  2. The last thing thing the script does is to traverse the .rcr file for the account and reinsert all future entries up until the cutoff date. At this time the cutoff date is set for a year in advance, but this can be changed by editing a variable at the beginning of the recur.pl script.

Config file format

The config (<account>.rcr) file is reminiscent of a crontab file. The format is slightly different, but the idea is generally the same. Specify the days, months, and years that the transaction will take place, then specify the transaction. One thing to note is that all fields must be separated by one <Tab> character. The script will then insert that transaction on those days.

For instance, the following entry will cause an auto loan payment to be inserted on the fifth of every month. Once the transaction has been entered, you can make any changes you like to it, such as adding

# Days  Months  Years   Description     Debit   Credit  Comment Category
# ----  ------  -----   -----------     -----   ------  ------- --------
5       *       *       Loan's R Us     100.00  0.00            Auto-Loan

Another variation would be the following entry which will insert a transaction every fourth of July.

4       7       *       Fireworks       35.00   0.00   Bang     Entertainment

The next entry will insert a transaction on the 15th and last day of every month.

15,last *       *       Salary          0.00    3.14   Peanuts  Salary Income

This entry will insert a transaction on the 1st day of January, April, July, and October.

*       1,4,7,10  *     Auto Insurance  200.00  0.00   Approx.  Insurance

REMEMBER, separate each field by a <Tab> character and not spaces.
Finally, a slightly different entry format will allow you to enter transactions based on a regular interval such as every other week. The first field specifies the start date of the interval. This can be any date, but recur.pl will never enter past recurring transactions. The transactions will kick in after the current date. Then next field is the interval in days. So 14 would specify an interval of every other week. The third field is ignored and not used. The last five fields are identical to the previous types of entries.

# Start Date  Intrvl Not Used  Description  Debit  Credit  Comment  Category
# ----------  ------ --------  -----------  -----  ------  -------  --------
19960119      14     *         Salary       0.00   2.78    Peanuts  Salary

Keeping a Manageable Data File Size

The script yearend.pl simply moves all uncleared transactions from the specified account to a new account. This helps keep file sizes smaller. Usage: yearend.pl <account>.cbb <new-account>.cbb



next up previous contents
Next: CBB Internals Up: CBB Check Book Balancer Previous: CBB Reference Manual




Mon Feb 26 23:26:50 CST 1996