Hi,
So in my script, I have a loop that creates columns, it works great, but I want to improve it a bit. I have data that comes in the form (number)|(character)|(number)|(character) etc. So I have alternating data types and I would like to print them in their normal form. Right now, the columns are in numeric form, so I can't see any of the character data. But if I change it to character format, I lose the numeric data structure. So I have this loop:
For(j = 1, j <= nitems(pinList), j++,
dt2 << New Column(pinList, Numeric, Continuous, Format("Best",12));
dt2 << New Column(pinList[j++], Character, Nominal);
);
Where I define all the column names in my pinList array. That works, except for the fact that it duplicates the entry at pinList (which in this case, is actually not a bad thing). the real problem comes in when I try to run another loop after it that parses that data which is delimited by a '|' and put it in the new columns.
For (i = 1, i <= nrows(dt2), i++,
one_test_result_list = words(column(dt2,"Test_Result"), "|");
For (k = 1, k <= nitems(one_test_result_list), k++,
Column(dt2, pinList) = one_test_result_list;
);
);
The last line runs once, and then breaks because the next entry in pinList has a "2" after it because when the columns were created, it duplicated every name. I'm not sure how to get this to work. I can define all the names I want in the pinList array but I want alternating column types of numeric and character.
Any help is greatly appreciated! Thanks!!