[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Importing tab-delimited text files or connecting to ODBC
From: |
Maks Romih |
Subject: |
Re: Importing tab-delimited text files or connecting to ODBC |
Date: |
17 Feb 2006 13:19:05 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 |
Markus Triska <triska@gmx.at> writes:
> Hi!
>
> Maks Romih wrote:
>
> > 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.
>
> You can use R (www.r-project.org) to handle a number of different
> table formats uniformly. For example, given test.txt like this:
>
> # directory size unit
> /home/tester1 200 MB
> /home/tester2 3000 KB
> /home/tester3 250 MB
>
> you can read it as a data frame:
>
> > data <- read.table("test.txt", as.is=c(T,F,T), skip=1)
>
> . . .
>
> All the best,
> Markus.
Thank you for the reply.
But I see I would need to specify the column types for every file I
want to load. This I don't like. The program should infer the types of
the columns automatically, either from the data itself or from the
data dictionary over ODBC.
Maks.