[Solved] Parsing countries file

Hi All
I would like to take contries for this file http://www.textfixer.com/resources/dropdowns/country-dropdown-iso-html.txt and save it in another file with the following structure .
Afghanistan, �land Islands , Albania, Algeria, American Samoa

Can anyone help me to do this ?

try this..

awk -F "[<>]" '/<option/{ print $3}' ORS="," file
1 Like

Try..

awk -F "[<>]" '/<option/ { printf "%s,", $3 }' file
1 Like

Thanks your solutions are working !