I have a file with the text in the fowling formatline 1,line 2,< Blank line >line 3,line 4,< Blank line >line 5,line 4,< Blank line >I need to put it in the format:line 1,line 2,< Blank line >line 3,line 4,< Blank line >line 5,line 4,< Blank line >So I'm trying:tr -d '\n' < myfile.txt > myfile_res.txtBut then I get all concatenated:line 1,line 2,line 3,line 4,line 5,line 4What I need it's: To remove '\n' only from lines containing characters and leave the blank lines and I believe it will work.Any idea how to encode this ?
trouble in formating text with tr
text processing