Quantcast
Channel: Replace newlines with literal \n - Stack Overflow
Viewing all articles
Browse latest Browse all 7

Answer by mvr for Replace newlines with literal \n

$
0
0

You could do this using sed and tr:

sed 's/$/\\n/' file | tr -d '\n'

However this will add an extra \n at the end.


Viewing all articles
Browse latest Browse all 7

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>