I have a file that contains data as follows: 

```
text1, text2, text3,
text4
text5, text6, text7,
text8

```

I need to bring the text4, text8 to the previous line that ends with a comma. How can I achieve this please ?

**EDIT:** Please, note that I have thousands of line. I need to automate the process.