Recording and recovering metadata in a tableI have a stacked data table with three columns that contain strings and another numeric.
A: unique identifier
B: text
C: text
As, Bs, Cs, Values
-----
A1, B1, C1, value11
A1, B1, C1, value12
A1, B1, C1, value13
A2, B2, C2, value21
A2, B2, C2, value22
A2, B2, C2, value23
Right now, I am creating a concatenated column name with the form "A (B) [C]" which I split to have the final table like so:
A1 (B1) [C1], A2 (B2) [C2],
Value 11, Value 21
Value 12, Value 22
Value 13, Value 23
I want to create a new column property that saves the As in this final table.
Do I need a loop with two lists to insert this property column by column?
Data Blending and CleanupRe: Recording and recovering metadata in a tableCheck out Associative Arrays
Re: Recording and recovering metadata in a tableSometimes As can have the pattern "abc (cde)" so better to use a mapping from the first table instead of Word().
is there a JSL dictionary we can use so the key is the column name and the value is the new property to save?
{"A1 (B1) [C1]": "A1",
"A2 (B2) [C2]": "A2"}Re: Recording and recovering metadata in a tableIf I understand correctly what you want - You have the property value already in the column name so you can could get it from there:
Names Default To Here(1);
dt = New Table("Untitled",
Add Rows(3),
Compress File When Saved(1),
New Column("A1 (B1) [C1]",
Character,
"Nominal",
Set Values({"Value 11", "Value 12", "Value 13"})
),
New Column("A2 (B2) [C2]",
Character,
"Nominal",
Set Values({"Value 21", "Value 22", "Value 23"})
)
);
colNames = dt << Get Column Names("String");
For(i = 1, i <= N Items(colNames), i++,
aVal = Word(1, colNAmes[i]);
Column(dt, colNames[i]) << Set Property("A_property", aVal);
);Re: Recording and recovering metadata in a tableSure.
Column: A1 (B1) [C1]
A_property: A1
Column: A2 (B2) [C2]
A_property: A2Re: Recording and recovering metadata in a tableCan you provide an example of what the contents of the new column property would look like?