Path: csiph.com!xmission!news.alt.net!not-for-mail From: owl Newsgroups: alt.os.linux Subject: Re: I Have Found My Editor Date: Sat, 22 Jun 2019 16:33:52 +0000 (UTC) Organization: O.W.L. Lines: 66 Message-ID: References: NNTP-Posting-Host: boom.rooftop.invalid X-Face: $BHf)vM$6p_?9L`jmOQ54JeNyL+%MZGGRfH8&grb[Y%-jU`MCPAQN=/SVDa{(/67bP(YB}rjV^h>cUh Xref: csiph.com alt.os.linux:57136 F. Russell wrote: > On Sat, 22 Jun 2019 14:00:55 +0000, owl wrote: > >> sed -e 's/\(.* .* .* .*\)\(ooo\)\(.* .*\)/\1XXX\3/g' afile >> > > Try it on this text file: > > [#] cat birdbrain.txt > Here cometh a bunch of ersatz columns. > > They contain silly "ooo" content. > > Here they be: > > |||||||||| |||||||||| |||||||||| |||||||||| ||||ooo||| > |||||||||| |||||||||| |||||||||| ||ooo||||| |||||||||| > |||||||||| |||||||||| ||||ooo||| |||||||||| |||||||||| > |||ooo|||| |||||||||| |||||||||| |||||||||| |||||||||| > |||||||||| |||||||||| |||||||||| |||||||||| |||||||||| > |||||||||| |||||||||| |||||||||| |||||||||| |||||||||| > |||||||||| ||||ooo||| |||||||||| ||||ooo||| |||||||||| > |||||||||| |||||||||| |||||||||| |||||||||| |||||||||| > |||ooo|||| |||||||||| |||||||||| ||ooo||||| |||||||||| > |||||||||| |||||||||| |||||||||| |||||||||| |||||||||| > |||||||||| |||||||||| |||||||||| |||||||||| |||||||||| > > This ends the "ooo" silly column nonsense. > > Now accept text as the limited format which it is. > > > Result: > > [#] sed -e 's/\(.* .* .* .*\)\(ooo\)\(.* .*\)/\1XXX\3/g' birdbrain.txt > > Here cometh a bunch of ersatz columns. > > They contain silly "XXX" content. > > Here they be: > |||||||||| |||||||||| |||||||||| |||||||||| ||||ooo||| > |||||||||| |||||||||| |||||||||| ||XXX||||| |||||||||| > |||||||||| |||||||||| ||||ooo||| |||||||||| |||||||||| > |||ooo|||| |||||||||| |||||||||| |||||||||| |||||||||| > |||||||||| |||||||||| |||||||||| |||||||||| |||||||||| > |||||||||| |||||||||| |||||||||| |||||||||| |||||||||| > |||||||||| ||||ooo||| |||||||||| ||||XXX||| |||||||||| > |||||||||| |||||||||| |||||||||| |||||||||| |||||||||| > |||ooo|||| |||||||||| |||||||||| ||XXX||||| |||||||||| > |||||||||| |||||||||| |||||||||| |||||||||| |||||||||| > |||||||||| |||||||||| |||||||||| |||||||||| |||||||||| > > This ends the "XXX" silly column nonsense. > > Now accept text as the limited format which it is. > [#] > > Oops! It appears that the concept of a column has been > erroneously to non-column areas. > Nope. It worked correctly. Columns with a given delimiter need not line up visually. In fact, not forcing columns to line up gives you much greater flexibility.