I have a data of 1 lac lines with the following format
abcde,1,2,3,4,
,ee
,ff
,gg
,hh
,mm
abcde,3,4,5,6,
,we
,qw
,as
,zx
,cf
abcde,1,5,6,7,
,dd
,aa
,er
....
....
....
abcde,1,5,4,3,
,kk
,gh
abcde is there in all record , it is starting word and below lines are sub records
I would like to concatenate to make the output like
abcde,1,2,3,4,ee,ff,gg,hh,mm
abcde,3,4,5,6,we,qw,as,zx,cf
.
.
.
.
abcde,1,5,4,3,kk,gh
Please help with a script either in Unix Shell or Perl