I am struggling to import my data. There are 400 files in CSV format with names organised by date like: Table1_20111003_YYYY_MM_DD_0000.dat. In each file over 20 colums and 86400 rows (seconds of each day). Weighting in total 8,4.

I want to create a matrix with the all the 400 files. I only need some columns from them and I need to pick 1 value every 10 min, so just safe 1 value every 600 values.

I saw some attempts to do this with a for loop. I am not sure if this will be efficient for this case.

I do normally use this comands to import :

data = Import[NotebookDirectory[] <> "File_flux.dat","CSV"][[1, 3 ;;]] /. -9999. -> NaN

But I am not sure how to import all 400 into a matrix

And select colummns like : col = data[[All, 1]].

Is there a better way to select values every 599 values?

Thank in advance for your assistance.

  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ – Michael E2 Jun 22 '16 at 4:47
  • $\begingroup$ You can format inline code and code blocks by selecting the code and clicking the {} button above the edit window. The edit window help button ? is also useful for learning how to format your questions and answers. You may also find this meta Q&A helpful $\endgroup$ – Michael E2 Jun 22 '16 at 4:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.