in reply to Replacing Lines in 100 Gig file

Resisting the temptation to say "Silly boy!", change quotes to suit.

perl -ple"/^</root>/ and map{ scalar <> } 1..3" file.xml >new.xml

Examine what is said, not who speaks.        The end of an era!
"But you should never overestimate the ingenuity of the sceptics to come up with a counter-argument." -Myles Allen
"Think for yourself!" - Abigail        "Time is a poor substitute for thought"--theorbtwo         "Efficiency is intelligent laziness." -David Dunham
"Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon

Replies are listed 'Best First'.
Re^2: Replacing Lines in 100 Gig file
by Anonymous Monk on Dec 17, 2004 at 18:25 UTC
    Hi Guys,
    you've all been most helpful. The solution I went with was the flip-flop operator. It did exactly what I needed. It is now tucked away in the bag-o-tricks.

    This board comes through every time I need something!