Date: Thu, 2 Feb 2012 07:22:36 +0100 From: Matthias Apitz <guru@unixarea.de> To: freebsd-questions@freebsd.org Subject: some kind of binary sed(1) command Message-ID: <20120202062236.GA3419@tinyCurrent>
next in thread | raw e-mail | index | archive | help
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@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120202062236.GA3419>