your_nmap_cmd |
sed -ne '
/^PORT/!d
h;n # grab PORT line & prepare for port info
\|/|!q # we are done once no / found so quitting
s|/.* open .*||p # display port num only for open state
G;D # without reading next input goto top
'