[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [groff] A poor mans Excel
From: |
Mike Bianchi |
Subject: |
Re: [groff] A poor mans Excel |
Date: |
Thu, 10 Oct 2019 08:55:02 -0400 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
> If there is interest, I'll post the script and an example.
Yes please.
Mike
On Thu, Oct 10, 2019 at 01:21:31PM +0200, Ulrich Lauther wrote:
> Hi all,
>
> I have written a small perlscript, that preprocesses tables
> and allows to
>
> - add the values in selected collums
> - to replace a table entry by the result of an expression
>
> Lines between
> .(
> and
> .)
> are processed.
>
> The ".(" line may contain the numbers of collums in which addition
> is requested, e.g.:
> .( add 2 5 7
> or just
> .( 2 5 7
>
> ".(" ".)" blocks my be nested; sums calculated at a lower level are
> propagated up.
>
>
> Table entries of the form E.<n> <expression> are repaced by the result
> of the expression rounded to n digits after the decimal point.
> "expression" is any valid perl expression.
> Variables used in the expression are
> - any valid perl variable (starting with "$")
> - $<n>, the value in column n in the current line
> - $S, sum of values in the column (where $S is placed) seen so far
> If $S or E.<n> is precedet by an "!", addition is suppressed for this
> table entry.
>
> As all tables of a document are processed by one perl-instance and perl
> variables can be created on the fly, values can be tranported from one
> table line to a later one or even to another table.
>
> Code size: 130 lines of perl
>
> Limitations: Multiline table enties are not supported.
>
> If there is interest, I'll post the script and an example.
>
> Kind regards,
>
> ulrich lauther
>
--
Mike Bianchi
Foveal Systems
973 822-2085
address@hidden
http://www.AutoAuditorium.com
http://www.FovealMounts.com