StealthFD
10-23-2008, 07:31 PM
Hey gang!
Looking for another suggestion... using the DelimitedStringToTable function, what is the best way to take the first row (or header) of a column and assign the content as a variable name?
Here is what I mean:
I need to process tables that always contain the same header fields (ie item1,item2,item3,etc.) but they are not always in the same order or position within the table (ie item2,item1,item3).
Table #1:
item1,item2,item3,item4
bread,milk,eggs,cheese
red,green,blue,yellow
Table #2:
item2,item1,item4,item3
milk,bread,cheese,eggs
green,red,yellow,blue
Both would generate the following:
item1 = bread
item2 = milk
item3 = eggs
item4 = cheese
item1 = red
item2 = green
item3 = blue
item4 = yellow
What is the best way to read that first row of a table and assign the contents to a variable that I can use through the rest of a for-in-do loop?
I hope that makes sense.
Thanks gang!
Looking for another suggestion... using the DelimitedStringToTable function, what is the best way to take the first row (or header) of a column and assign the content as a variable name?
Here is what I mean:
I need to process tables that always contain the same header fields (ie item1,item2,item3,etc.) but they are not always in the same order or position within the table (ie item2,item1,item3).
Table #1:
item1,item2,item3,item4
bread,milk,eggs,cheese
red,green,blue,yellow
Table #2:
item2,item1,item4,item3
milk,bread,cheese,eggs
green,red,yellow,blue
Both would generate the following:
item1 = bread
item2 = milk
item3 = eggs
item4 = cheese
item1 = red
item2 = green
item3 = blue
item4 = yellow
What is the best way to read that first row of a table and assign the contents to a variable that I can use through the rest of a for-in-do loop?
I hope that makes sense.
Thanks gang!