I tried many different approaches, but I could not solve the following problems, I appreciate your help: What is the best way to import many data files and names this files?
import.nb (9.38 KB)
I tried many different approaches, but I could not solve the following problems, I appreciate your help: What is the best way to import many data files and names this files?
import.nb (9.38 KB)
Hi Luis,
Not sure what you mean by
What is the best way to import many data files and names this files
I assume you want to have the symbols generated in dd to be set to the contents of the corresponding file.
Is there a reason to hardcode the Range? Why not Range@Length@names?
dd = Symbol /@ ("data" <> ToString[#] & /@ Range[325])
Then
MapThread[(#1 = #2) &, {dd, allData}]
Thank you very much, you helped me solve the problem.
You are welcome.
Rather than setting individual symbols to the content of a file you might want to consider using an Association / Dataset instead. If you do data analysis that requires data from multiple files then using individual symbols is very cumbersome and error prone. One way to do this
data = AssociationMap[Import, names] // Dataset
The keys are the file names (much better than data1, data2, …) and the values are the content of the corresponding file.