i need to merge multiple lines from the output of nmap into a single row
FROM:
Nmap scan report for example.com
22/tcp open ssh
80/tcp open http
111/tcp open rpcbind
1720/tcp open h323q931
5432/tcp open postgresql
Nmap scan report for example.com
22/tcp open ssh
80/tcp open http
81/tcp open hosts2-ns
111/tcp open rpcbind
1720/tcp open h323q931
Nmap scan report for example.com
22/tcp open ssh
111/tcp open rpcbind
1720/tcp open h323q931
Nmap scan report for example.com
22/tcp open ssh
TO:
Nmap scan report for example.com
22/tcp open ssh 80/tcp open http 111/tcp open rpcbind 1720/tcp open h323q931 5432/tcp open postgresql
Nmap scan report for example.com
22/tcp open ssh 80/tcp open http 81/tcp open hosts2-ns 111/tcp open rpcbind 1720/tcp open h323q931
Nmap scan report for example.com
22/tcp open ssh 111/tcp open rpcbind 1720/tcp open h323q931
Nmap scan report for example.com
22/tcp open ssh
For 1 host there should be 2 lines. 1st one is starting with Nmap scan ... and the other row is open port info. I saw many questions about multiple lines into 1 line with awk but could'not come up with something.