Here is my first pass script. The approach should give you what you need to see what might need to be adjusted with your complete data table
Names Default To Here( 1 );
dt = Current Data Table();
// Create the new columns
dt << New Column( "domain_frequency_core", character );
dt << New Column( "Data" );
// Create the static part for the column domain_frequency_core
startString = "Data@" || Word( 1, :string_result[1], ":" );
// Read into a memory variable the entire string, minus the startString component
theString = Word( 2, :string_result[1], ":_" );
// Initialize the looping variables
outerLoop = 1;
theRow = 0;
// Loop through the major groupings in the data
While( Word( outerLoop, theString, "%" ) != "",
// Strip off the subpart of the string
majorWord = Word( outerLoop, theString, "%" );
// Get the second component of the start string
startStringSuffix = "@" || word(1,majorWord,"^") || "@";
// Initialize the inner loop value, starting with word 2
innerLoop=2;
// Loop through the subgroup finding each numeric component
While( word(innerLoop, majorWord, "^V") != "",
// Add a new row
if(theRow !=0, dt<<add rows(1));
theRow++;
// Add the new column values
:unit[theRow]=:unit[1];
:domain_frequency_core[theRow]= startString || startStringSuffix || char(innerLoop-2) ;
:Data[theRow]=num(word(innerLoop, majorWord, "^V"));
innerLoop++;
);
outerLoop++;
);
Jim