in reply to Re: file alteration
in thread file alteration

A = <tr> B = </tr> perl -00pi.~* -e 's/\<tr\>\n\<\/tr\>\n//g' $file
it does not do anything.

Replies are listed 'Best First'.
Re^3: file alteration
by hippo (Archbishop) on Apr 14, 2015 at 13:05 UTC

    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
Re^3: file alteration
by davido (Cardinal) on Apr 15, 2015 at 02:18 UTC

    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