Posted By

plexus on 06/19/07


Shell multiline whitespace regexp sed newline patternspace

Versions (?)

Sed convert multiline whitespace to single newline

 / Published in: Bash

Converts whitespace that spans multiple lines into a single newline, needs improvement

  1. $ cat filename |sed '/^[\t ]*$/{
  2. N
  3. /^\n[\t ]*$/d
  4. }'

Report this snippet  

You need to login to post a comment.