in reply to file alteration

Hi, I would like to see what you have tried.

Perl is the programming world's equivalent of English

Replies are listed 'Best First'.
Re^2: file alteration
by Anonymous Monk on Apr 14, 2015 at 05:36 UTC
    A = <tr> B = </tr> perl -00pi.~* -e 's/\<tr\>\n\<\/tr\>\n//g' $file
    it does not do anything.

      No idea what all those backslashes are doing in there.

      $ cat file x <tr> </tr> y <tr> </tr> z $ perl -00pi.~ -e 's/<tr>\n<\/tr>\n//g' file $ cat file x y z

      I can understand where you might feel that you're saving everyone's time and simplifying the problem's explanation by using A and B as stand-ins for more complex constructs, but the truth is that you would have saved your time, and the time of those who contributed answers had you simply told us from the start that A and B represented <tr> tags. Then we could have suggested an appropriate solution from the start, rather than getting around to it eventually after all the facts emerged.

      And in my opinion, kudos to jeffa for the most appropriate solution for handling HTML.


      Dave