MathGroup Archive 2009

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

Search the Archive

Re: MOVE/EXPORT FILES AT ONCE


Alain Mazure wrote:
> Hi
> 
> How is it possible to move, at once, to e.g another directory , files 
> identified with e.g:
> 
> FileNames["*.dat"]
> 
> I.e, what is the equivalent of the classic cp *.dat and better the 
> equivalent of cp *.*  ?

Here's one way to do it.

files=FileNames["*.dat"];

move[x_] :=
  RenameFile[x,
   "C:\\Users\\HPR\\Documents\\math\\directory2" <> x];  (* needless to 
say, replace the path with your own *)

Map[move,files]

-- 
Helen Read
University of Vermont


  • Prev by Date: Re: Iterative solution difficulty
  • Next by Date: update notebook calculations on startup?
  • Previous by thread: Re: MOVE/EXPORT FILES AT ONCE
  • Next by thread: Re: MOVE/EXPORT FILES AT ONCE