Ah! A use for perl's flip-flip operator:
#!/usr/bin/perl -w while (<DATA>) { next if m|</root>|..m|<root>|; print; } print "</root>\n"; __DATA__ <?xml version="1.0" encoding="UTF-8"?> <root> <some_xml></some_xml> </root> <?xml version="1.0" encoding="UTF-8"?> <root> <some_xml></some_xml> </root> <?xml version="1.0" encoding="UTF-8"?> <root> <some_xml></some_xml> </root>
-b
In reply to Re: Replacing Lines in 100 Gig file
by bgreenlee
in thread Replacing Lines in 100 Gig file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |