Loading External Files Into A List - Proper Set-up

liwenna liwenna at gmail.com
Wed Jan 13 11:15:34 UTC 2010


Hello mister mcgree!

Not quite sure about the child-thing but could something be amiss with
the formatting of your .txt file so that a procedure ends up in, for
instance, the nested column instead of the procedure column?

The thread you link too contains a LOT of information and features
while judging from your post I think you are only seeking for a way to
load a .txt file into a list.

Here is a bit more shorthand explanation of the 'basic way to load
a .txt file into a list'.

The .txt file should contain all the column headers of a 'normal
list' (e.g. weight nested procedure) and all your own variables (e.g.
stim) on the first line. Each 'collumn' must be separated by a tab.
The next lines of the .txt files hold the 'content' of each 'cell'
again divided by tabs.

Here is a simple .txt file (but google group doesn't handle tabs too
well... so it is a bit messy).

Weight	Nested	Procedure	stim
1		trialproc	2
1		trialproc	3
1		trialproc	1
1		trialproc	4

Now in e-prime simply add an inline to the procedure that holds your
list and place it right before your list stating something like:

---------------------------

Listname.LoadMethod = ebLoadMethodFile

Listname.Filename = "files/listsubject" & c.GetAttrib("subject") &
".txt"

Listname.Load

-------------------

In the above example listname is the name of your list. Alo: the
"files/" part denotes e-prime to look into a folder called files
that's located within the folder that contains the e-studio file. I do
this to keep things somewhat tidy, if you want to keep your .txt files
in the same folder as your e-studio file is, remove the files/ part.
The listsession" & c.GetAttrib("session") & ".txt" is to show how to
select .txt files based on, for instance, subject number. For subject
1 a file called listsubject1.txt will be opened, for subject 2
listsubject2.txt etc etc. A feature like that is usually needed in
cases where you need lists to be loaded from files.

For the die-hard coders among us you could/should insert a
listname.reset either somewhere AFTER the list has run or at the total
beginning of the above code, before it loads the .txt file into the
list.

Now: you still need a procedure for your list to run. I usually create
the procedure in the list 'the normal way' and leave it sitting there
but you could opt to leave your 'list to be filled' totally empty and
move the procedure to the 'unreferenced e-objects'. The moment
the .txt file is loaded into the list e-prime will start referring to
it.

And that... is pretty much all there is to it.

Unless you need more advanced options of course. In that case: let us
know what you need.

Good luck!


liw

On Jan 13, 1:22 am, mcgree <mcg... at gmail.com> wrote:
> Hello,
>      I am trying to use the Factor.Load method to create a list from a
> text file that I specify.  (See Post:http://groups.google.com/group/e-prime/browse_thread/thread/74f87efd6....)
> However, when I try to run the example from the help file I receive
> the following error when I try to compile the program:  "child item is
> a procedure".  I know a little about programming, but not much.  Can
> anyone help me to fix this problem?  Thank you very much in advance!
-------------- next part --------------
-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.




More information about the Eprime mailing list