Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1998
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1998

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

Search the Archive

Re: Importing CSV (comma separated values) files?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg13878] Re: Importing CSV (comma separated values) files?
  • From: "Hossein Kazemi" <kazemi at javanet.com>
  • Date: Wed, 2 Sep 1998 01:31:10 -0400
  • Organization: JavaNet Cafe
  • References: <6s5ok6$df4$2@dragonfly.wolfram.com>
  • Sender: owner-wri-mathgroup at wolfram.com

I have a macro that does the job.  Here it is:

(* Read Comma-delimited file f="filename", c=#columns, r=#rows *)

ReadCommaFile[f_String,c_Integer,r_Integer]:=
  Block[{m,x},m=OpenRead[f];

x=Table[Read[m,Record,RecordSeparators->{",","\n"}],{r},{c}];Close[f];ToExpr
ession[x]]

Hossein Kazemi





  • Prev by Date: MathFonts with MiKTeX 1.11 and Win32
  • Next by Date: Re: Lissajous W (was Re: Looking for Contractor)
  • Previous by thread: MathFonts with MiKTeX 1.11 and Win32
  • Next by thread: Re: Lissajous W (was Re: Looking for Contractor)