Quantcast
Viewing latest article 1
Browse Latest Browse All 8

Answer by Walter A for Replace newlines with literal \n

With the -zoption you can do

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

or

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

Viewing latest article 1
Browse Latest Browse All 8

Trending Articles