I am trying to read several .dat files from a certain folder by specifying the path in Mathcad 15.
I wonder if there is any script function to do that instead of inserting all the files one by one?
Solved! Go to Solution.
Something like this:
If your files are sequential in their name - "data_1.dat", "data_2.dat", etc., you can write a program loop that will read the data from each file and place them all in a matrix. This approach worked very well for me.
Hope this helps!
Yes - what Luc has shared is very similar to what I have implemented. You can get a bit more complicated by monitoring the size of any data file and reading files that have different row and column counts. Units can be read-in as well with some other tricks (of course the data needs to be set-up to accommodate this), but Luc has captured the fundamental approach well.
Is there a way that we give the path and the file ext, and then Mathcad returns all the files having that ext?
You mean like this:
Sorry, only in Mathcad 11, not in Mathcad 15.