some kind of binary sed(1) command

Matthias Apitz guru at unixarea.de
Thu Feb 2 06:22:42 UTC 2012


Hello,

I have a normal ASCII file wich has in some places two lines of '*',
separated by an empty line, i.e.

....\n
*********************\n
\n
*********************\n
....\n

and I want to substitute the \n between the star lines by \f; the
'binary' sed command would just be 

	s/*****\n\n*****/*****\n\f*****/

which ofc does not work with sed(1) because it is line oriented;
I could write something in perl, C, awk or whatever language, but I
would prefer to do it with the normal commands... any ideas?

Thanks

	matthias
-- 
Matthias Apitz
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e <guru at unixarea.de> - w http://www.unixarea.de/
UNIX since V7 on PDP-11 | UNIX on mainframe since ESER 1055 (IBM /370)
UNIX on x86 since SVR4.2 UnixWare 2.1.2 | FreeBSD since 2.2.5


More information about the freebsd-questions mailing list