From: Maks Romih <maksr@snt.si>
Subject: Importing tab-delimited text files or connecting to ODBC
Date: 16 Feb 2006 09:44:20 +0100 [thread overview]
Message-ID: <uvevf4rrv.fsf@snt.si> (raw)
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.
next reply other threads:[~2006-02-16 8:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-16 8:44 Maks Romih [this message]
2006-02-16 23:33 ` Importing tab-delimited text files or connecting to ODBC Markus Triska
2006-02-17 12:19 ` Maks Romih
2006-02-17 0:04 ` Thien-Thi Nguyen
2006-02-17 14:29 ` Maks Romih
2006-02-17 16:35 ` Eric Pement
2006-02-17 17:01 ` Maks Romih
2006-02-17 19:06 ` Tim McNamara
2006-02-18 18:25 ` Peter S Galbraith
2006-02-18 5:53 ` Thien-Thi Nguyen
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=uvevf4rrv.fsf@snt.si \
--to=maksr@snt.si \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.