From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Maks Romih Newsgroups: gmane.emacs.help Subject: Importing tab-delimited text files or connecting to ODBC Date: 16 Feb 2006 09:44:20 +0100 Organization: Slovenija OnLine - SiOL Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1140079923 564 80.91.229.2 (16 Feb 2006 08:52:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 16 Feb 2006 08:52:03 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Feb 16 09:51:59 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F9erj-0007Oq-8S for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Feb 2006 09:51:55 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F9eri-0002ld-1B for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Feb 2006 03:51:54 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!kanaga.switch.ch!switch.ch!kanja.arnes.si!news-hub.siol.net!news.siol.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 44 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 Original-NNTP-Posting-Host: 193.189.170.154 Original-X-Complaints-To: abuse@siol.net Original-X-Trace: news.siol.net 1140079460 193.189.170.154 (Thu, 16 Feb 2006 09:44:20 MET) Original-NNTP-Posting-Date: Thu, 16 Feb 2006 09:44:20 MET Original-Xref: shelby.stanford.edu gnu.emacs.help:137604 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: news.gmane.org gmane.emacs.help:33229 Archived-At: Hi all! I have a question about lisp in Emacs for Windows What would be the best way to import some tables, like a tab delimited copy-paste chunk from excel. I would like to get the table into Emacs Lisp so that a table would be a big list of rows, where a row would be a list of atoms, either raw strings or, when possible, converted to Lisp numbers and symbols. I'm considering programming some low level function like >(defun read-tab-delimited (fn) > (find-file fn) > (let (row rows) > (while (re-search-forward "\\([^ >]*\\)\\([ >]\\)" nil t) > (let ((token (match-string 1))) > (push token row) > (when (equal (match-string 2) " >") > (push (nreverse row) rows) > (setq row nil)))) > (kill-buffer nil) > (nreverse rows))) but I don't like it. I would still have a lot to work with converting strings into numbers, converting pairs of double quotes into single quotes, etc. It would be much better if I could somehow call ODBC from emacs. Then I would simply connect to some Microsoft Access MDB or any other relational database, and pump the data from there. If the ODBC is impossible to call from emacs, I would maybe use CLISP and CLSQL to connect to ODBC, convert the data and then load data into emacs with the Elisp function read. I'm not sure if CLSQL and CLISP for Cygwin works, this I'm going to ask on the comp.lang.lisp. If someone of you had similar problems and have some idea, I would be greatly thankful for any suggestions. Maks.