<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />Hi,
I am looping through some data sets and trying to label the data from each by its file name. Everything comes together fine except the filename field is blank. I created a table by hand to try to get the new column code from jump which looked something like this:
mytable << New Column( "Filename", Character, Nominal, Set Values( {"filename"} ) );
This seems simple enough, so I tried inserting it into my code which I have summarized below:
y = Files In Directory(mypath);
For(i = N Items(y), i > 0, i--,
/*Get my Data*/
/*Now label the data with the filename*/
mytable << New Column( "Filename", Character, Nominal, Set Values( y ) );
/*Merge with other results*/
);
I have tried several variations of Set values. /*edit*/ The column always populates with "subscript" if I use {y}. I have tried something like mystring = y; ... Set Values(mystring). I have been through the scripting guide and google and I cant find the answer as to what is wrong. It must be something simple but it escapes me.
Thanks for your help.
Set Values require a list (or matrix) and it seems that Set Values does not fully evaluate the argument.
Try:
mytable << New Column( "Filename", Character, Nominal, Set Values( Eval List( {y[i]} ) ) );