I'm looking for an awk script that can merge the following two records into 1 record. Can anyone help?
StaticAddrInfo: s1-1-1-1@xx.net@0:0:0:0:0:0@1.1.
1.1
The key is that the second record does not contain a ':'
First the 1 cause an error
Even with nawk ?
Its a shorthand for {print}
So here the script for old awk:
awk '
/HsiaStaticAddrInfo:/{
printf $0;getline;if($0~/:/)printf "\n"
}
{ print }
' /path/to/input
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.