Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2000
*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 2000

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

Search the Archive

Re: read/write numbered files

  • To: mathgroup at smc.vnet.net
  • Subject: [mg23471] Re: read/write numbered files
  • From: Lars Hohmuth <larsh at wolfram.com>
  • Date: Thu, 11 May 2000 00:54:19 -0400 (EDT)
  • Organization: Wolfram Research, Inc.
  • References: <8fb2l1$i13@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

francesco siano wrote:
> 
> Hi all, is there a way to open/write files named
> file1.dat, file2.dat, ...file40.dat  within a Do loop or something like
> that ?
> Next step would be to do the same with file11.dat, file12.dat,
> ...file21.dat, ...
> Any help would be appreciated. Thanks.
> -Francesco Siano

Something like the following?

In[8]:=
For[i = 1, i < 3, i++, Export[StringJoin["file", ToString[i], ".dat"],
{i}]]
In[9]:=
<< file1.dat
Out[9]=
1
In[10]:=
<< file2.dat
Out[10]=
2


  • Prev by Date: Re: Starting Mathematica kernal from external programs
  • Next by Date: Re: Random Geometric (long)
  • Previous by thread: Re: read/write numbered files
  • Next by thread: Re: Random Geometric (long)