From: Alan Mackenzie <acm@muc.de>
Subject: Re: blank cells in ses range
Date: Sat, 27 Nov 2004 17:32:38 +0000 [thread overview]
Message-ID: <mndaoc.o8.ln@acm.acm> (raw)
In-Reply-To: kx9sm6wmi2c.fsf@panix5.panix.com
rb <rb@panix.com> wrote on 26 Nov 2004 16:11:39 -0500:
> What I would like is the sum of, say, Column "E", which has rows 1 -
> 10, of which approx. half are empty.
> E
> 1 41
> 2 11
> 3
> 4 9
> 5
> 6 20
> 7
> 8
> 9 15
> 10 96
> What I would like is for E10 to be (apply '+ (ses-range E1 E9)), with
> the empty cells simply eliminated from the calculation. I can't figure
> out how to make (ses+ &rest ARGS) work with the range calculation.
> Thanks very much for any help,
Does it have to be an Emacs solution?
I would suggest you use AWK here. AWK is designed to cope with awkward
things (hence the name ;-) like missing fields, and so on. The following
script would do the right thing:
# awk '{tot += $2}; END {print tot}' foo.txt
> rb
> --
--
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").
next prev parent reply other threads:[~2004-11-27 17:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-26 21:11 blank cells in ses range rb
2004-11-27 17:32 ` Alan Mackenzie [this message]
2004-11-27 21:49 ` rb
2004-11-27 22:08 ` Stefan Monnier
2004-11-27 23:52 ` rb
2004-11-28 0:54 ` rb
2004-11-29 15:05 ` Stefan Monnier
2004-11-29 17:05 ` Jonathan Yavner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=mndaoc.o8.ln@acm.acm \
--to=acm@muc.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).