1 |
#!/usr/bin/perl -w
|
2 |
|
3 |
if ($#ARGV != 2-1 ) {
|
4 |
print "usage: perl modErrorStreamCfg.pl CurrentRun Dir\n";
|
5 |
exit;
|
6 |
}
|
7 |
|
8 |
$CurrentRun = $ARGV[0];
|
9 |
$Dir = $ARGV[1];
|
10 |
|
11 |
my @files = <${Dir}/*>;
|
12 |
open (OLD, "<HLT_config_${CurrentRun}.py");
|
13 |
open (NEW, ">HLT_config_${CurrentRun}_0.py");
|
14 |
while ($line = <OLD>) {
|
15 |
if ($line =~ "fileNames") {
|
16 |
my @change = split('\(', $line);
|
17 |
print NEW "$change[0]\(\n";
|
18 |
print NEW "\t\t'file:$files[0]',\n";
|
19 |
print NEW "\t),\n";
|
20 |
}
|
21 |
elsif ($line =~ "store/data") {
|
22 |
$nextline = <OLD>;
|
23 |
}
|
24 |
elsif ($line =~ "file:") {
|
25 |
$nextline = <OLD>;
|
26 |
}
|
27 |
elsif (1) {
|
28 |
print NEW $line;
|
29 |
}
|
30 |
}
|
31 |
|
32 |
close (OLD);
|
33 |
close (NEW);
|
34 |
|