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

Answer by Walter A for Replace newlines with literal \n

$
0
0

With the -zoption you can do

sed -z 's/\n/\\n/g' file

or

sed -z "s/\n/\\\n/g" file

Viewing all articles
Browse latest Browse all 8

Trending Articles



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