Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: arkoreIn an effort to avoid developing a Python node I'm trying to figure out a BRAINscript method of identifying columns based on their field name and string cat them together and pipe the output to a single column. An example will make it much clearer:
prefix|col1 prefix|col2 col3 col4
------------------------------------------------
test data more data apple delta
test aaa yesterday grape delta
test bbb tomorrow cherry theta
test cccc freedom orange apha
With the output being:
prefix col3 col4
------------------------------------------------
test datamore data apple delta
test aaayesterday grape delta
test bbbtomorrow cherry theta
test ccccfreedom orange apha
I can get a list of the field names using inputFields("in1") but I need to split() each list element by a delimiter (i.e. "|") and then find which columns match the prefix. I think I need to use a combo of the apply() function but cannot get it to work for string operators like split().
I would greatly appreciate any assistance or simply to be told I should just go with Python.