[ILUGC] Re: How to insert a new line above 2 lines (above the pattern match)

  • From: Baskar Selvaraj <baskar@xxxxxxxxxxxx>
  • To: ilugc <ilugc@xxxxxxxxxxxxx>
  • Date: Sat, 5 Sep 2020 14:25:19 +0530

On Sat, Sep 5, 2020 at 1:58 PM Gopinath M <mgopi1990@xxxxxxxxx> wrote:


sed 's|^[0-9][0-9]*$|\n\n&|' file > a.out

Hi Gopinath,

Thanks.

This is a good and acceptable solution.

S. Baskar
---
Mailing List Guidelines: https://ilugc.in/mailing-list-guidelines
Web: http://ilugc.in/
Internet Relay Chat: #ilugc on irc.freenode.net

Other related posts: