This article applies to:
E-Prime allows List objects to be populated at runtime from a tab-delimited text file (i.e., .txt file). To do so, set the Load Method property of the List to "File" and the Filename property to the name of the text file. As with other experiment resource files, we recommend placing the text file in the same folder as the experiment specification file (i.e., .es3, .es2). By doing so, no path information needs to be included in the Filename property.
The text file must define all of the List column headings on the first row, specify the first three columns in order as Weight, Nested, and Procedure, and separate each column entry with a tab.
To create a tab-delimited text file:
- Use any type of word processing software such as Notepad or Microsoft Word that can create text file.
- Save the file with a .txt extension.
- Separate all entries in the file with a tab character.
- Enter the following as the first three columns on the first row of the file: Weight Nested Procedure
- Add additional column headings after the Procedure for the experiment-specific attributes.
- Enter rows of attribute values as needed. For any blank values (for example if not using Nested lists), enter a tab.
NOTE: Separating attribute values with a tab may cause the attribute values to appear misaligned with the column headings.
A text file looks similar to the following image:
NOTE: The "Nested" column values are blank in the image above. The entries "X" and "Y" represent the values for the attribute named Stimulus.
NOTE: The text file must be properly formatted. An experiment generates a runtime error if the text file contains extraneous tabs, carriage returns, or other non-printing characters. An error is also throw if tabs are missing between any column, if the attribute names not defined on the first row ,or if the first three attribute names are not in the correct order (i.e., Weight Nested Procedure).
To reference the tab-delimited file on the List object:
- Select the List Object in the Structure.
- If not already completed, configure the List to reflect the procedure to be run and the Attributes that are defined in the text file. The List should contain a single row and the Procedure should be set to the name of the Procedure Object to be run (and should match the value defined in the text file). Specifying the Procedure enables the Structure view to show the sequence of objects that will be presented when the experiment runs. Specifying the Attribute names allows the AttribSense feature to reference the Attributes on Text and Slide sub-objects.
- While not required, we recommend setting the Weight for the single row on the List to 0.
- Open the Properties Window.
- Set the LoadMethod to "File".
- Set the Filename to the name of the .txt file that will populate the LIst when the experiment runs.
NOTE: The List object is not updated to show the contents of the file; instead, the contents of the List are not populated until the experiment runs. When the List object is edited in E-Studio to set the LoadMethod to "Filename" then the contents of the Weight, Nested, and Procedure columns are greyed out and are no longer editable to indicate that the List contents are assigned from an external file.
To run the example experiment, download either the E-Prime 2.0 or E-Prime 3.0 version of the experiment and the ListContents.txt file. Place the text file in the same folder as the .es2 or .es3 file.