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

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 8

Latest Images

Trending Articles



Latest Images