[Date Index] [Thread Index] [Author Index]
RE: reading all the files in one directory
Hi Sofia, > 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. It's straightforward .... Change to the directory; get a list of the file names; read them, prefereably using Import; continue. For example, below I read all the txt files into a list. The i'th element of the list contains data from the i'th file. SetDirectory["c:/Tmpfiles"]; ifile = FileNames["*.txt"] idata = Import[#, "LIST"] & /@ ifile; If it is sensible to do so (it depends on the structure of the individual lists), you can plot the data individually using ListPlot[#]& /@ idata; Or all together using MultipleListPlot[idata]; Regards, Dave.