Merging multiple lines

I do have a text file with multiple lines on it. I want to put the lines of text into a single line where ever there is ";"

for example

ert, ryt, yvig,
fgr;
rtyu, hjk, uio,
hyu,
hjo;
ghj, tyu, gho,
hjp, jklo,
kol;

The resultant file I would like to have is

ert, ryt, yvig, fgr;
rtyu, hjk, uio, hyu,hjo;
ghj, tyu, gho, hjp, jklo, kol;

Please let me know how to do this either in awk or sed

I don't see any obvious way to guess when you want spaces added to the end of a line when it is joined to an earlier line. If you are willing to always add a space when a line is joined, this seems to work:

awk '
! /;/ {printf("%s ", $0)
	next
}
1' file

which produces the output:

ert, ryt, yvig, fgr;
rtyu, hjk, uio, hyu, hjo;
ghj, tyu, gho, hjp, jklo, kol;

instead of:

ert, ryt, yvig, fgr;
rtyu, hjk, uio, hyu,hjo;
ghj, tyu, gho, hjp, jklo, kol;

as you requested.

sed version:

sed -n ':a /;$/!N;s/\n//g;ta;p' file
ert, ryt, yvig,fgr;
rtyu, hjk, uio,hyu,hjo;
ghj, tyu, gho,hjp, jklo,kol;