Saturday, September 04, 2021

Re: vi: count occurrences of a substring

> Date: Sun, 5 Sep 2021 09:11:21 +1000
> From: Reuben ua Bríฤก <u5644051@anu.edu.au>

> easy peasy. to sed all spaces into newlines

you might as well just

sed 'y/ /\n/'

the inverse is almost as easy

sed '1h;1!H;$!d;g;y/\n/ /'

im sure yoar kicking yourself for not seeing such a simple solution.

No comments:

Post a Comment