namitai
1
I have a file with the input as below:
Host = example.com,
service = void
Host = example1.com,
service = void1
Host = example2.com,
service = void2
Need the output as below:
example.com,void
example1.com,void1
example2.com,void2
Please reply
Thanks
$ awk -F\= 'NR%2==1{a=$2;getline;printf("%s%s\n",a,$2)}' inputfile
example.com, void
example1.com, void1
example2.com, void2
$ awk -F= '{print $2|"paste - -"}' infile
example.com, void
example1.com, void1
example2.com, void2
$
awk '{p=$NF;getline;print p $NF}' infile