MathGroup Archive 2006

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

Search the Archive

Re: reading all the files in one directory


You're somewhat light on details, so I can only guess at an appropriate
answer for your case.  One possibility is to use FileNames[] to get a
list of files.  Create a function which takes a single filename as its
argument, and apply it to the list.  For example:

myFiles = FileNames[];
myFunc[file_] := (tmp = Import[file,"Text"]; Print[file,"\n",tmp])
myFunc /@ myFiles;

Ana Sofia Figueiredo wrote:
> Hi,
>
> Could anyone please tell me how can a read all the files in one directory?
> I have to read around 60 files with odd names.
> 
> Many thanks
> Sofia


  • Prev by Date: Re: reading all the files in one directory
  • Next by Date: RE: reading all the files in one directory
  • Previous by thread: Re: reading all the files in one directory
  • Next by thread: RE: reading all the files in one directory