diff --git a/cheat/cheatsheets/sed b/cheat/cheatsheets/sed index f60b269..b9b5f1a 100644 --- a/cheat/cheatsheets/sed +++ b/cheat/cheatsheets/sed @@ -12,3 +12,6 @@ sed -i -r 's/^\s+//g' file.txt # Remove empty lines and print results to stdout: sed '/^$/d' file.txt + +# replace newlines in multiple lines +sed ':a;N;$!ba;s/\n//g' file.txt