With sub
function of awk
you could try following. Though experts always advise to use tools like xmlstarlet which understand xml better.
awk '{sub(/</(gu)?id/,"123&")} 1' Input_file
OR in case you want to make code to use ignorecase to match capital/smal letters then try following.
awk '{sub(/</([gG][Uu])?[iI][Dd]/,"123&")} 1' Input_file
OR in case you have GNU awk
in with you try with IGNORECASE
option:
awk -v IGNORECASE=1 '{sub(/</(gu)?id/,"123&")} 1' Input_file
Explanation: Using sub
(substitution) function of awk
to substitute </guid>
OR </id>
with 123</guid>
and 123</id>
respectively.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…