Given a data file tmp_file,
5 0 0 0
0 5 0 0
0 0 6 0
0 0 0 6
the following two commands render different results, why is that?
sed 's/\n/ /g' tmp_file
5 0 0 0
0 5 0 0
0 0 6 0
0 0 0 6
sed 's/0/ /g' tmp_file
5
5
6
6
EDIT:
a previous post, How can I replace a newline (\n) using sed?, was suggested to have resolved the issue. Surely the solution is the same, but the question looks seemingly different in the eye of a newbie. Also, one should not expect anybody is able to find the right answer among millions of posts even with hours of research online as done in the current post. I would rather withdraw the post if a negative mark is given due to being similar to previous posts.