1611 shaares
17 private links
17 private links
2 results
tagged
newline
Try query-replace
enter
[ space ]
enter
M-j
enter
!
enter
It's an interesting dilemma. There are two obstacles to doing this in sed. One is that sed operates line by line and never sees the newline endings. Second, sed's regular expressions don't provide a way to exactly match a newline character.
If you really want to do this, don't use sed; use tr.
cat file | tr '\n' ','