Linking a Lookup Table to a Text File

You link a Lookup Table to a text file (at runtime) by selecting “ASCII Text File” from the Data Source field at the bottom of the Lookup Table dialog:

When you do so, a new tab (Text File) is added to the dialog that allows you to define the name of the text file:

You must first enter the name of a text file by pressing the Options >> button. 

   Note: If you select a file in the same directory as (or a subdirectory below) your GoldSim .gsm file, GoldSim will subsequently display just a local path.  If you select a file in a directory above your .gsm file, it will display the full path.

Once you have selected a file, you can subsequently use the Options >> button to select a different file.  You can also use the Options>> button to open the selected file in your default text editor.

The format for the text file is identical to the format used when importing into a Lookup Table directly from the Editing dialog.

   Note: When data is imported from a text file into a Lookup Table, it will stop the import and report an error if the values of the independent variables do not increase monotonically as you move downward/across the table.  That is, unlike the case when you enter the data directly, GoldSim will not automatically sort the entries.

GoldSim automatically imports data from the text file at the start of a simulation if either 1) the filename has been changed; or 2) the file itself has been changed since the last import.  You can also import data manually at any time prior to running a simulation (e.g., so you can view it) by pressing the Import Data button in the Text File tab.

   Note: When you link a Lookup Table to a text file, the Edit Data… button changes to View Data….  If you press this button to access the dialog displaying the data, you will note that they are no longer editable.  Once you are linked to a text file in this way, you can not edit the data manually unless you change Data Source back to “None”.  When you do so, GoldSim keeps the imported data and makes it editable.

If you want to ensure that you do not import data from the text file that has been inadvertently edited since you last imported the data, you can choose to “Lock onto” a text  file (by checking “Lock onto selected file” from the Options>> button).  If you are locked onto a file, GoldSim will not allow the simulation to run if the file has been modified in any way (the file is set to read only when it is locked onto).  In order to run a simulation with a changed file, you must first remove the lock (by clearing “Lock onto selected file” from the Options>> button).

Related Topics…

Learn more about: