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: [mg23462] Re: [mg23452] read/write numbered files
  • From: Ken Levasseur <Kenneth_Levasseur at uml.edu>
  • Date: Thu, 11 May 2000 00:54:12 -0400 (EDT)
  • Organization: UMass Lowell
  • References: <200005100632.CAA17900@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

Francesco:

Here is an example of the kind of thing that you want to do.

A trivial notebook definition:
In[1]:=
nbook[k_] := Notebook[{Cell[ToString[k], "Text"]}]

Here is how you can save a family of such notebooks
In[2]:=
NotebookSave[nbook[#], "MGexample" <> ToString[#]<>".nb"] & /@ Range[10, 13]

Here is how you can retreive them
In[3]:=
NotebookOpen["MGexample" <> ToString[#]] & /@ Range[10, 13]


Hope this helps.

Ken Levasseur
UMass Lowell
Instructor: the online course Introduction to Mathematica
 (http://www.uml.edu/dept/math/m419.html)  Starts May 21!


  • Prev by Date: [TS 3227] ListInterpolation
  • Next by Date: RE: Re: matrices, dot products and convergents ofcontinued fractions
  • Previous by thread: read/write numbered files
  • Next by thread: Re: read/write numbered files