0

I am calculating with the depth data recorded in a number of files with extension .log.

The depth data is like this and I loaded it by means of Mathematica:

Import["C:\\Homeworks\\depth\\file1.log"]
{"2016/01/13 00:00:30", 42, 754}, {"2016/01/13 00:01:00", 42, 754}, 
{"2016/01/13 00:01:30", 42, 753}, {"2016/01/13 00:02:00", 42, 752}, 
{"2016/01/13 00:02:30", 42, 753}, {"2016/01/13 00:03:00", 42, 754}

I succeed in obtaining the depth data and transforming it into 42.754, 42.754, 42.753, 42.752, 42.753, 42.754, etc.

However, this only processes the data in one file. However, I have in my folder a group of about 10 files. How can I read in all the data in a folder in an easier way than to do it individually?

m_goldberg
  • 107,779
  • 16
  • 103
  • 257
Mehmet
  • 587
  • 2
  • 10

1 Answers1

0

In case that your file names are file1.log, file2.log,...,file10.log try the following

Table[Import[i], {i, FileNames["C:\\Homeworks\\depth\\file*.log"]}]

The context of FileName command should be the directory containing your files.

demm
  • 1,533
  • 9
  • 13
  • Absolutely, Mr. demm your answer captured the main problem. Dr. Belisaruis Flatten[ __,1] was also nice trick. – Mehmet Feb 11 '16 at 03:06