I love using the Word() function when the extraction is simple. Here is another approach using the Regex() function. The same approach can be used if the extraction pattern is not simple, just by changing the regular expression.
Names Default to Here( 1 );
// set up example
dt = New Table( "Untitled",
Add Rows( 4 ),
New Column( "File Name",
Character,
"Nominal",
Set Values(
{"Test Name Date ID# Wafer and Device ID1 #ID comment",
"Test Name Date ID# Wafer and Device ID2 #ID different comment",
"Different Test Name Date ID# Wafer and Device ID1 #ID comment",
"Different Test Name Date ID# Wafer and Device ID2 #ID different comment"
}
)
)
);
// make a data column for result
dt << New Column( "Extract", "Character", "Nominal" );
// compute row-wise result
For Each Row(
:Extract = Regex( :File Name, "ID# (.+) #ID", "\1" );
);
Here is the result: