Skip to main content
precision
Source Link
Stéphane Gimenez
  • 29.4k
  • 3
  • 79
  • 88

grep will filter out empty lines since they don't match any pattern. In the case empty line separators appear in the original file you can let them pass through, adding -e "^$".

If those empty lines are not present in the original file, you'll have to add them. This is aan example of how to do it:

 tail -f production.log | grep -e … | sed 's/\(^Processing \)/\n\1/'

Edit: if you want an empty line after every other line use sed 's/$/\n/' instead. And of course you can add as many \n as you like.

grep will filter out empty lines since they don't match any pattern. In the case empty line separators appear in the original file you can let them pass through, adding -e "^$".

If those empty lines are not present in the original file, you'll have to add them. This is a example of how to do it:

 tail -f production.log | grep -e … | sed 's/\(^Processing \)/\n\1/'

grep will filter out empty lines since they don't match any pattern. In the case empty line separators appear in the original file you can let them pass through, adding -e "^$".

If those empty lines are not present in the original file, you'll have to add them. This is an example of how to do it:

 tail -f production.log | grep -e … | sed 's/\(^Processing \)/\n\1/'

Edit: if you want an empty line after every other line use sed 's/$/\n/' instead. And of course you can add as many \n as you like.

Source Link
Stéphane Gimenez
  • 29.4k
  • 3
  • 79
  • 88

grep will filter out empty lines since they don't match any pattern. In the case empty line separators appear in the original file you can let them pass through, adding -e "^$".

If those empty lines are not present in the original file, you'll have to add them. This is a example of how to do it:

 tail -f production.log | grep -e … | sed 's/\(^Processing \)/\n\1/'