Leser: 2
8 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
&SchreibeExcel;
sub SchreibeExcel
{
open(XLS, ">>datei.csv") or die $!; #speichert
foreach (@erste_Zeile)
{
chomp ($erste_Zeile[$index]);
chomp ($zweite_Zeile[$index]);
chomp ($dritte_Zeile[$index]);
chomp ($vierte_Zeile[$index]);
print XLS "$erste_Zeile[$index], ";
print XLS "$zweite_Zeile[$index], ";
print XLS "$dritte_Zeile[$index], ";
print XLS "$vierte_Zeile[$index],";
print XLS "$funfte_Zeile[$index]";
$index++
}#end foreach
}#end SchreibeExcel
der neue code wegen dem modul sieht jetzt so aus:
sub SchreibeExcel
{
my $workbook = new Spreadsheet::WriteExcel("datei.cvs");
my $sheet1 = $workbook -> add_worksheet( "übersicht" );
my $k=0;
my $s=0;
my $s1=1;
my $s2=2;
my $s3=3;
my $s4=4;
foreach (@erste_Zeile)
{
chomp ($erste_Zeile[$index]);
chomp ($zweite_Zeile[$index]);
chomp ($dritte_Zeile[$index]);
chomp ($vierte_Zeile[$index]);
chomp ($funfte_Zeile[$index]);
$sheet1 -> write( $k, $s, "$erste_Zeile[$index]" );
$sheet1 -> write( $k, $s1, "$zweite_Zeile[$index]" );
$sheet1 -> write( $k, $s2, "$dritte_Zeile[$index]" );
$sheet1 -> write( $k, $s3, "$vierte_Zeile[$index]" );
$sheet1 -> write( $k, $s4, "$funfte_Zeile[$index]" );
$index++;
$k++;
}#end foreach
$workbook -> close();
}#end SchreibeExcel
8 Einträge, 1 Seite |