Skip to main content
1-Visitor
February 24, 2012
Question

Is Indirect referencing to a data file possible?

  • February 24, 2012
  • 2 replies
  • 3499 views

I use references to text files to import data into my MathCAD worksheets.

On occasion, I have multiple versions of the data to analyze.

In order to change to another data file, I currently need to right-click the reference, select Properties, select the Reference tab, and then modify the name of the referenced file.

What I would like to do is have a string variable on the worksheet (this would be the name of the referenced file). Changing this variable would change the referenced file.

Is this possible at all with a script or control of some kind?

Thanks,

2 replies

23-Emerald I
February 24, 2012

You can create a variable with a string, and reference that variable.

With a mistbox and a script you can go further. (But not with me, you need an expert.)

Three seperate text files for data, one file to read in any or all. You'll need to edit the path in the "File" matrix.

SFatz1-VisitorAuthor
1-Visitor
March 30, 2012

Fred,

This is helpful, but doesn't quite work for me because the second column of data in my txt file is not numerical. Using your method forces everything to numbers.

I would attach a file to better explain, but am not sure how to do so.

19-Tanzanite
March 30, 2012

Steven Fatzinger wrote:

I would attach a file to better explain, but am not sure how to do so.

Select 'Use advanced editor' (top right of reply editor). Then go to bottom left of the advanced editor to select and post your file.

Alan

19-Tanzanite
February 25, 2012

If you mean a referenced Mathcad worksheet, then no. There is no way to change the reference programmatically. It's been requested many times. But if it's just data can you not put it in a text file?