I'm trying to join all lines in a file so there is only one line remaining. Here is what I've tried:
This seems like it would work, but it joins line 1 and 2 and then lines 3 and 4, but it doesn't join the new line 1 with the new line 2.
Is there a better way other than sed to do this?
Thanks!
Code:
sed '$!N;s/\n//g' /files/multiline.txt > /files/singleline.txt
This seems like it would work, but it joins line 1 and 2 and then lines 3 and 4, but it doesn't join the new line 1 with the new line 2.
Is there a better way other than sed to do this?
Thanks!