MathGroup Archive 1999

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

Search the Archive

Re: importing multiple files

  • To: mathgroup at
  • Subject: [mg18647] Re: importing multiple files
  • From: paulh at (P.J. Hinton)
  • Date: Thu, 15 Jul 1999 01:45:41 -0400
  • Organization: Wolfram Research, Inc.
  • References: <7mej9h$>
  • Sender: owner-wri-mathgroup at

In article <7mej9h$9hg at>, "pytr" <pytr224 at> writes:

> I need to import multiple files in text format which are written by another
> system. I don't want to use math link at this time.
> The basic routine needed is
> SetDirectory  ["c:\dumpdir/myreports"]
> Label [beginproc]
> flst= FileNames[ "*z.txt"]
> filename=First[flst]
> Get[filename]
> DeleteFile[filename]
> Goto beginproc
> using the above file list, I need to import and run each file, then erase
> each file after processing,then look for new files.
> Any advice?
> The current program only loops once..

Scan[] is your friend in this case.  Here is a rework of your example.

flst= FileNames["*z.txt"];
Scan[(Get[#]; DeleteFile[#])&, flst]

P.J. Hinton	
Mathematica Programming Group		paulh at
Wolfram Research, Inc.
Disclaimer: Opinions expressed herein are those of the author alone.

  • Prev by Date: NSolve with varying parameter
  • Next by Date: Re: Binary System Problem
  • Previous by thread: importing multiple files
  • Next by thread: Re: importing multiple files