I have below code inside my awk script
if ( $0 ~ /SVC IN:/ )
{
svc_in=substr( $0,23 , 3);
if (msg_start == 1 && msg_end == 0)
{
msg_arr[msg_lnno++]=$0;
}
}
else if ( $0 ~ /^SVC OUT:/ )
{
svc_out=substr( $0, 9, 3);
if (msg_start == 1 && msg_end == 0)
{
msg_arr[msg_lnno++]=$0;
}
}
else if ( $0 ~ /^MSGEND/ )
{
if ( $svc_in$svc_out != "ABCABC" )
{
print .....
}
else
{
print ..
}
)
The issue here is it works fine when both in and out values are strings and gets an error when one of them is a number.
My input file has diff combinations, how can we convert it when we get a number in any one value?