Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: stonysmithYou can easily use inputFields() to get a list of columns and then a while{} to process the values
The challenge here is that within BrainScript, you can not dynamically set OUTPUT column names.
x=inputFields(1)[5] #returns the name of the fifth field
fn="1:"+x #build field name
v=field(fn) #get field value by name
but, there is NO way to do this, even if the field already exists on the output
emit 1282821 as fn # output value to a variable column name - not allowed
emit ONLY allows string constants as field names..
emit 1282821 as "oldfieldname"
================
You CAN accomplish the desired effect if you move over to Python or Java, but that would require knowledge of one of those two languages.