From 75fab5231f8c5112cd63835a122c6f90d0c22f4f Mon Sep 17 00:00:00 2001 From: James Zhu Date: Sat, 6 Sep 2014 20:42:49 +0800 Subject: [PATCH] Update sed --- cheat/cheatsheets/sed | 3 +++ 1 file changed, 3 insertions(+) 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