Help for this page

Select Code to Download


  1. or download this
    
    perl -pi -e 'if(/<level1(\sid=\".*\")>/){$a=$1};if(/<level2>/){$_=~s/(
    +<level2)>/$1$a>/g}' input
    ...
    
    perl -pi -e '$a=m;(<level(1|2))(\sid=\".*\")*>;;$a?$2==1?$b=$3:$_=~s;(
    +$1);$1$b;g:1;' input
    
  2. or download this
    
    perl -pi -e 'm;(<level(1|2))(\sid=\".*\")*>;;$&?$2==1?$b=$3:$_=~s;($1)
    +;$1$b;g:1;' input
    
  3. or download this
    
    perl -pi -e 'm;(<level(1|2))(\sid=\".*\")*>;;$&?$2==1?$b=$3:$_=~s;($1)
    +;$1$b;g:1' input
    
  4. or download this
    
    perl -pi -e '/l1(\sid=.*)>/?$a=$1:s;l2>;l2$a>;' input