From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: D. Goel Newsgroups: gmane.emacs.help Subject: Re: ** Q: HOW TO MANIPULATE STRINGS IN A FILE WITH A LISP FUNCTION ** Date: 16 Sep 2002 09:07:46 -0400 Organization: Posted via Supernews, http://www.supernews.com Sender: help-gnu-emacs-admin@gnu.org Message-ID: <87znuiulp9.fsf@computer.localdomain> References: <9e8ebeb2.0209151930.79f76ae9@posting.google.com> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1032182759 14804 127.0.0.1 (16 Sep 2002 13:25:59 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 16 Sep 2002 13:25:59 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17qvsz-0003qM-00 for ; Mon, 16 Sep 2002 15:25:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17qvtF-0001fe-00; Mon, 16 Sep 2002 09:26:13 -0400 Original-Path: shelby.stanford.edu!nntp.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!west.cox.net!cox.net!sn-xit-02!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Original-X-Complaints-To: abuse@supernews.com Original-Lines: 26 Original-Xref: nntp.stanford.edu gnu.emacs.help:104940 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:1495 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:1495 > My problem is very simple for an emacs guru. More than one solution is > very welcome. > > I have a list of numbers in a file as follows: > > ABC98789 > DDE90898889 > FRE9090909 ;; returns somethign like (("ABC" "DEF" "GGH") ("1123" "223" "332")) (defun gnuist-contents (file) "" (let (let-num let num (letters nil) (numbers nil)) (find-file file) (goto-char (point-min)) (while (forward-word 1) (setq let-num (format "%S" (sexp-at-point))) (setq let (substring let-num 0 3)) (setq num (substring let-num 3 (length let-num))) (push let letters) (push num numbers)) (list (reverse letters) (reverse numbers))))