Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <attribute name="picture" type="binary">
  2.  
  3. </attribute>
  4.  
  5. sed '|<attribute name="picture" type="binary">|,|</attribute>|{||!d}' Original.file
  6.  
  7. sed 'type="binary">','</attribute>'{//!d}' Original.file > New.file
  8.  
  9. #!/usr/bin/perl
  10.  
  11. use strict;
  12. use warnings;
  13.  
  14. use XML::Twig;
  15.  
  16. my $twig = XML::Twig->new(
  17. 'twig_handlers' => {
  18. 'attribute[@type="binary" and @name="picture"]' => sub { $_->delete }
  19. }
  20. );
  21.  
  22. $twig ->parsefile ( 'your_file' );
  23. $twig -> print;|
  24.  
  25. awk '/<attribute name="picture" type="binary">+$/,/</attribute>+$/{next}1' original.txt > new.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement