The ledger file format is quite simple, but also very flexible. It supports many options, though typically the user can ignore most of them. They are summarized below.
The initial character of each line determines what the line means, and how it should be interpreted. Allowable initial characters are:
NUMBER
DATE[=EDATE] [*|!] [(CODE)] DESC
If ‘*’ appears after the date (with optional effective date), it indicates the entry is “cleared”, which can mean whatever the user wants it t omean. If ‘!’ appears after the date, it indicates d the entry is “pending”; i.e., tentatively cleared from the user's point of view, but not yet actually cleared. If a ‘CODE’ appears in parentheses, it may be used to indicate a check number, or the type of the transaction. Following these is the payee, or a description of the transaction.
The format of each following transaction is:
ACCOUNT AMOUNT [; NOTE]
The ‘ACCOUNT’ may be surrounded by parentheses if it is a virtual
transactions, or square brackets if it is a virtual transactions that
must balance. The ‘AMOUNT’ can be followed by a per-unit
transaction cost, by specifying ‘@ AMOUNT’, or a complete
transaction cost with ‘@@ AMOUNT’. Lastly, the ‘NOTE’ may
specify an actual and/or effective date for the transaction by using
the syntax ‘[ACTUAL_DATE]’ or ‘[=EFFECTIVE_DATE]’ or
‘[ACTUAL_DATE=EFFECtIVE_DATE]’.
=
After this initial line there should be a set of one or more
transactions, just as if it were normal entry. If the amounts of the
transactions have no commodity, they will be applied as modifiers to
whichever real transaction is matched by the value expression.
~
After this initial line there should be a set of one or more
transactions, just as if it were normal entry.
!
;
Y
P
P DATE SYMBOL PRICE
N SYMBOL
N SYMBOL
D AMOUNT
D $1,000.00
C AMOUNT1 = AMOUNT2
C 1.00 Kb = 1024 bytes
i, o, b, h