Re: pie multiline replace



Thomas Bätzler wrote:
perl -i -ple '$_ = "cc\n$_" if $p =~ m/aa/ && m/bb/; $p=$_'

Thanks. looks non-trivial for me. Anyway I will copy this idiom into my cheat sheet.

Thank Gunnar for suggestion too. However I prefer one-liner.

regard,
.



Relevant Pages

  • Re: pie multiline replace
    ... Anyway I will copy this idiom into my cheat sheet. ... Thank Gunnar for suggestion too. ... However I prefer one-liner. ...
    (perl.beginners)
  • Re: Parse HTML
    ... Yeah, ... be a one-liner response to a one-liner posting. ... suggestion will take more than one line to do its job properly. ...
    (microsoft.public.vb.general.discussion)
  • Re: A Presumably Easy Question for the Experts
    ... [macro suggestion by Dave Peterson] ... > with several rows with multiple-column entries, I wish to create a new ... > sheet's full row entries. ... > I can in this regard. ...
    (microsoft.public.excel.programming)
  • Re: solve a newspaper quiz
    ... any suggestion for improvement? ... The obvious one-liner. ... Maybe not an improvement, but more compact (I ... c and avoid a divide by zero exception. ...
    (comp.lang.python)
  • Re: Provinf bounded variation
    ... following suggestion. ... while where cosine decreases: ... Is it right to regard the problem this way? ... is BV on bounded intervals; ...
    (sci.math)