How do i replace blank lines in a file with some text using sed?
-
Man page for sed: https://www.lightnetics.com/post/3334
Sample file is:
cat linefile This is line one This is line two This is line three
Use this, ^$ mean blank line here.
$ sed 's/^$/blank this!/' linefile
Result:
This is line one
blank this!
This is line two
blank this!
This is line three
© Lightnetics 2024