On Sun, Oct 30, 2011 at 13:53, Craig Earls <[email protected]> wrote:
> Thanks, that's getting closer.  I really want the output to be a single line
> showing only the total number of shares (and the commodity if I can't avoid
> it)  e.g.
>
>> ledger bal --limit "commodity == 'VIFSX'"
> 250.0000
>
> or
>
>> ledger bal --limit "commodity == 'VIFSX'"
> 250.0000 VIFSX
>
>
> If I try to control it using a format statement
>
> 10:50:17 ~/FinanceData > ledger  bal -l "commodity == 'VIFSX'" --format
> "%(strip(display_total))\n"
> 250.0000 VIFSX
> 125.0000 VIFSX
> 125.0000 VIFSX
> 250.0000 VIFSX
>
> Which reflects the sub accounts.  I suppose I could just ignore all but the
> first line, but there must be a way to limit it to the top level account.
>

I can't help with the ledger command but you could dip into the Unix
toolbox and do something like

ledger  bal -l "commodity == 'VIFSX'" | head --lines=1

-- 
Mitchell Surface

Reply via email to