Не могли бы вы попробовать выполнить следующие действия в awk
.
awk 'match($0,/conf=[^;]*/){print $0,substr($0,RSTART+5,RLENGTH-5);next} 1' Input_file
Объяснение: Добавление пояснения к приведенному выше коду сейчас.
awk ' ##Starting awk program here.
match($0,/conf=[^;]*/){ ##Using match function of awk to match regex from string conf= till semi colon comes.
print $0,substr($0,RSTART+5,RLENGTH-5) ##Printing current line and then sub-string whose starting point of RSTART+5 and ending point is RLENGTH-5
next ##next will skip all further statements from here.
} ##Closing BLOCK for match function here.
1 ##Mentioning 1 will print lines, those ones which are not having conf string match so it will simply print them.
' Input_file ##Mentioning Input_file name here.
Вывод будет следующим.
A 10 20 bob.1 ID=bob.1;Parent=bob;conf=XF;Note=bob_v1 XF
A 20 30 bob.2 ID=bob.2;Parent=bob;Note=bob_v1;conf=XF XF