MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Read a delimited text file into a mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg62072] Re: Read a delimited text file into a mathematica
  • From: Bill Rowe <readnewsciv at earthlink.net>
  • Date: Thu, 10 Nov 2005 02:51:49 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

On 11/9/05 at 3:45 AM, youngjin.michael at gmail.com wrote:

>I am new to Mathematica and would like to know if I can read a
>delimited text file into a mathematica and work with it. I was
>gooling and reading the online help, but I could not find it.

Yes, Mathematica can do this. For comma delimited files probably the simplest method would be

Import[filename, "CSV"]

For tab delimited you could use either

Import[filename, "Table"] or
Import[filename, "TSV"]

or if the file contained numeric data only and used whitespace as delimiters then

ReadList[filename, Number, RecordLists->True] 

would work and be faster.
--
To reply via email subtract one hundred and four


  • Prev by Date: FileNames[] in a loop..
  • Next by Date: Re: Converting Rationals into Reals
  • Previous by thread: Re: Read a delimited text file into a mathematica
  • Next by thread: Re: Read a delimited text file into a mathematica