~maddevelopers/mg5amcnlo/WWW5_caching

« back to all changes in this revision

Viewing changes to users/mardelcourt/PROC_970226/PROC_970226/bin/internal/extract_banner-pl

  • Committer: John Doe
  • Date: 2013-03-25 20:27:02 UTC
  • Revision ID: john.doe@gmail.com-20130325202702-5sk3t1r8h33ca4p4
first clean version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl -w
 
2
 
 
3
$numArgs = $#ARGV + 1;
 
4
 
 
5
if ($numArgs < 2){
 
6
    print "You must supply at least one event file name and one text file name where to write the banner\n";
 
7
    exit;
 
8
}
 
9
 
 
10
$events=$ARGV[0];
 
11
$banner=$ARGV[1];
 
12
 
 
13
if (open FILE,"$events"){
 
14
}
 
15
else {
 
16
     print "Event file $events not found\n";
 
17
     exit;
 
18
}
 
19
 
 
20
open(OUT,"> $banner");
 
21
 
 
22
$found=0;
 
23
 
 
24
EXTRACT: while ($i = <FILE>){
 
25
    if($i =~ '</header>'){last EXTRACT;}
 
26
    if($found==1){print OUT "$i";}
 
27
    if($i =~ '<header>'){$found=1;}
 
28
}
 
29
 
 
30
close(OUT);