From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.help Subject: Re: blank cells in ses range Date: Sat, 27 Nov 2004 17:32:38 +0000 Organization: muc.de e.V. -- private internet access Message-ID: References: NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1101585645 23616 80.91.229.6 (27 Nov 2004 20:00:45 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 27 Nov 2004 20:00:45 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 27 21:00:38 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CY8kI-0000Lv-00 for ; Sat, 27 Nov 2004 21:00:38 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CY8ta-0000HI-97 for geh-help-gnu-emacs@m.gmane.org; Sat, 27 Nov 2004 15:10:14 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!t-online.de!newsfeed.r-kom.de!news.m-online.net!news.space.net!news.muc.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 38 Original-NNTP-Posting-Host: acm.muc.de Original-X-Trace: marvin.muc.de 1101585029 4587 193.149.49.134 (27 Nov 2004 19:50:29 GMT) Original-X-Complaints-To: news-admin@muc.de Original-NNTP-Posting-Date: 27 Nov 2004 19:50:29 GMT User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686)) Original-Xref: shelby.stanford.edu gnu.emacs.help:126968 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:22371 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:22371 rb 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").