cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How to insert data files in Mathcad 15 using a script

SOLVED
Highlighted
Amethyst

How to insert data files in Mathcad 15 using a script

Hi all,

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?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: How to insert data files in Mathcad 15 using a script

Something like this:

LucMeekes_0-1603127060250.png

Success!
Luc

View solution in original post

7 REPLIES 7
Highlighted

Re: How to insert data files in Mathcad 15 using a script

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!

Highlighted

Re: How to insert data files in Mathcad 15 using a script

Hi @ChrisKaswer. Thank you for your reply. Do you have a template to share?

Highlighted

Re: How to insert data files in Mathcad 15 using a script

Something like this:

LucMeekes_0-1603127060250.png

Success!
Luc

View solution in original post

Highlighted

Re: How to insert data files in Mathcad 15 using a script

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.

 

Good luck!

Highlighted

Re: How to insert data files in Mathcad 15 using a script

Thank you @LucMeekes for sharing that. That is very useful. 

Highlighted

Re: How to insert data files in Mathcad 15 using a script

Is there a way that we give the path and the file ext, and then Mathcad returns all the files having that ext? 

Highlighted

Re: How to insert data files in Mathcad 15 using a script

You mean like this:

LucMeekes_0-1603136980728.png

Sorry, only in Mathcad 11, not in Mathcad 15.

 

Luc

 

 

Announcements