You're viewing a comment by FernandoBasso and its responses.

FernandoBasso Permalink
March 07, 2015, 12:42

@vignesh,

This is one possible solution for your question:

sed $'s/\.$/\\n/' < nl.txt

It uses a special shell quoting mechanism to insert a newline. It should work on Bash, Zsh, Ksh, and possibly other shells.

Join #Sed on freenode.

Comment Responses

vignesh Permalink
March 07, 2015, 14:20

@FernandoBasso
thank u .... but that command is matchin a . at every end of line... can i need to add a new blank line only after the end of paragraph... can u please modify the command

Anirudh Permalink
February 03, 2016, 10:48
sed -ne '
   # store the paragraph in hold space
   H; $bend; /^[.]$/!d

   :end
      # append a newline at the paragraph"s end & print it
      g; s/^\n//; s/\(\n\)[.]$/&\1/p;
      # null hold in preparation for storing the next para
      s/.*//; h
'

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "coding_95": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.