3 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/perl -w
use strict;
my $XML = 'template.xml';
my $CSV = 'jobs.csv';
my $OUT = 'neudatei.xml';
open(READ1, "$XML")
open(READ2, "$CSV")
open(WRITE1, "> $OUT")
my @datei = <READ1>;
while (my $i = <READ2>)
{
my @a = split(/;/,$i); # CSV-Zeilen splitten
my $name = "$a[0]";
my $titel = "$a[1]";
my $aufruf = "$a[2]";
chomp $aufruf;
foreach(@datei)
{
$_ =~ s/NAME/$name/;
$_ =~ s/TITEL/$titel/;
$_ =~ s/AUFRUF/$aufruf/;
print WRITE1; }
}
close(READ1);
close(READ2);
close(WRITE1)
or die "Fehler beim Schliessen von '$OUT': $! \n";
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
<JOBS ... name="Job A">
...
<Title>Backup-Job</Title>
...
<MSCRI><![CDATA[backup.sh
...
...
<JOBS ... name="Job A">
...
<Title>Backup-Job</Title>
...
<MSCRI><![CDATA[backup.sh
...
...
<JOBS ... name="Job A">
...
<Title>Backup-Job</Title>
...
<MSCRI><![CDATA[backup.sh
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<JOBS ... name="Job A">
...
<Title>Backup-Job</Title>
...
<MSCRI><![CDATA[backup.sh
...
...
<JOBS ... name="Job B">
...
<Title>Loesch-Job</Title>
...
<MSCRI><![CDATA[delete.sh
...
...
<JOBS ... name="Job C">
...
<Title>Kopier-Job</Title>
...
<MSCRI><![CDATA[copy.sh
...
3 Einträge, 1 Seite |