I have data (points) that I have to import from another program into Mathematica, so I can build it. I have control over how the items will be written to the file, so I can put them in any way. What is the way to import them into Mathematica? Since I'm going to use StreamDensityPlot, the variable I need to pass to StreamDensityPlot should be as follows:
data = { { { a, b, c }, {a, b, c}, {a, b, c}, { a, b, c }, {a, b, c}, {a, b, c}, { a, b, c }, {a, b, c}, {a, b, c}, } ... { { a, b, c }, {a, b, c}, {a, b, c}, { a, b, c }, {a, b, c}, {a, b, c}, { a, b, c }, {a, b, c}, {a, b, c}, } }
How would you advise me to put the data in an intermediate text file? And what should I use to import it? I tried to import ["mytext.txt", "List"], having my own text file with something in the form shown above, but it seems like Mathematica treats dots as strings, and I can do nothing with them. Is there a way to convert strings to arbitrary data, as is possible in other languages (if they are valid in this new data type)?
Summary:
- Can I convert a string, such as "5" to a number, in Mathematica? If so, how?
- Is it possible to convert a string like "{1, 2, 3}" to a list in Mathematica? If so, how?
- Can I upload a CSV file to a list of lists, as shown above in Mathematica?
thanks