Menggunakan gnu awk
(karena RS)
awk '{$1=$1} NR%2==1 {printf "%s,",$0} NR%2==0' RS="[,\n]" file
XXXXXXXXXX,YYYYYYYYYY
TTTTTTTTTTT,UUUUUUUUUU
RRRRRRRRR,JJJJJJJJJ
111111111111,22222222222
333333333333,44444444
5555555,666666
EEEEEEEE,WWWWWW
QQQQQQQ,PPPPPPPP
{$1=$1}
Membersihkan dan menghilangkan spasi tambahanNR%2==1 {printf "%s,",$0}
mencetak bagian ganjilNR%2==0
mencetak bagian genap dan baris baruRS="[,\n]"
set catatan ke ,
atau baris baru