I have a tab delimited data frame with a final column containing nested information that is '|' delimited. Note that all rows maintain this nested parenthetical structure preceded by 'REP='
col1 col2 col3 col4
ID1 text text text...REP=(info1|info2|info3)
ID2 text text text...REP=(info1|info2|info3)
I would like to process this last column such that all info inside the parenthetical is a new column:
col1 col2 col3 col4 newcol newcol2 newcol3
ID1 text text text info1 info2 info3
ID2 text text text info1 info2 info3
I would think that an AWK command would be useful but am having trouble structuring this appropriately. Any help would be much appreciated.