1
2
3
4
5
6
7
8
3434 OUT 2014-04-08 07:17:43 16 25 3338762777 X unknown 615860
3434 OUT 2014-04-08 07:38:14 200 209 3338762777 X unknown 615860
3851 OUT 2014-04-08 10:11:22 104 118 3338768047 3338768047 unknown 3116
3851 OUT 2014-04-08 10:44:01 37 46 3338768047 3338359382 unknown 03094519504
3851 OUT 2014-04-08 11:46:40 53 85 3338768047 3338768047 unknown 765900
3851 OUT 2014-04-08 13:10:22 40 85 3338768047 3338768047 unknown 0309443582
3935 OUT 2014-04-08 08:33:48 8 21 3338757522 3338757522 unknown 459687
3965 OUT 2014-04-08 08:13:34 34 61 3338700192 3338700192 unknown 703553
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
#!/usr/bin/perl
########################
# Modul Definition
#########################
use warnings;
use strict;
##########################
# Parameter Definition
#########################
my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst);
my($date,$clock);
my ($File1);
my (@Array);
my ($cus_ID,$No_calls,$sum_call_time);
##########################
##########################
system("clear");
##########################
# Time-Calculation
##########################
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
$date =sprintf("%04d-%02d-%02d",$year+1900,$mon+1,$mday);
$clock =sprintf("%02d:%02d:%02d",$hour,$min,$sec);
###############################
# File-Operation
$File1 = "./workspace/inputfile.log";
if ( -e $File1 ){
open (iFile,"<$File1") || die $!;
}
@Array = <iFile>; # Copy File 2 Array
while (@Array){
$ct = shift(@Array);
$cus_ID = $Array[0];
print "Customer-ID: $cus_ID\n";
}
my @cols = split /\t/, $line;
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
use strict; use warnings; use Data::Dumper; # da kommen die Daten hin my $data = []; # Daten einlesen while(<DATA>){ # DATA means Handle my %line = (); @line{qw(lfdnr dev date time nr1 nr2 nr3 xnr well lastnr)} = unpack 'A9 A4 A11 A9 A7 A7 A13 A13 A17 A11', $_; push @$data, \%line; } print Dumper $data; __DATA__ 3434 OUT 2014-04-08 07:17:43 16 25 3338762777 X unknown 615860 3434 OUT 2014-04-08 07:38:14 200 209 3338762777 X unknown 615860 3851 OUT 2014-04-08 10:11:22 104 118 3338768047 3338768047 unknown 3116 3851 OUT 2014-04-08 10:44:01 37 46 3338768047 3338359382 unknown 03094519504 3851 OUT 2014-04-08 11:46:40 53 85 3338768047 3338768047 unknown 765900 3851 OUT 2014-04-08 13:10:22 40 85 3338768047 3338768047 unknown 0309443582 3935 OUT 2014-04-08 08:33:48 8 21 3338757522 3338757522 unknown 459687 3965 OUT 2014-04-08 08:13:34 34 61 3338700192 3338700192 unknown 703553
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
$VAR1 = [
{
'nr1' => '16',
'xnr' => 'X',
'dev' => 'OUT',
'time' => '07:17:43',
'date' => '2014-04-08',
'well' => 'unknown',
'lastnr' => '615860',
'nr3' => '3338762777',
'nr2' => '25',
'lfdnr' => '3434'
},
{
'nr1' => '200',
'xnr' => 'X',
'dev' => 'OUT',
'time' => '07:38:14',
'date' => '2014-04-08',
'well' => 'unknown',
'lastnr' => '615860',
'nr3' => '3338762777',
'nr2' => '209',
'lfdnr' => '3434'
},
{
'nr1' => '104',
'xnr' => '3338768047',
'dev' => 'OUT',
'time' => '10:11:22',
'date' => '2014-04-08',
'well' => 'unknown',
'lastnr' => '3116',
'nr3' => '3338768047',
'nr2' => '118',
'lfdnr' => '3851'
},
{
'nr1' => '37',
'xnr' => '3338359382',
'dev' => 'OUT',
'time' => '10:44:01',
'date' => '2014-04-08',
'well' => 'unknown',
'lastnr' => '03094519504',
'nr3' => '3338768047',
'nr2' => '46',
'lfdnr' => '3851'
},
{
'nr1' => '53',
'xnr' => '3338768047',
'dev' => 'OUT',
'time' => '11:46:40',
'date' => '2014-04-08',
'well' => 'unknown',
'lastnr' => '765900',
'nr3' => '3338768047',
'nr2' => '85',
'lfdnr' => '3851'
},
{
'nr1' => '40',
'xnr' => '3338768047',
'dev' => 'OUT',
'time' => '13:10:22',
'date' => '2014-04-08',
'well' => 'unknown',
'lastnr' => '0309443582',
'nr3' => '3338768047',
'nr2' => '85',
'lfdnr' => '3851'
},
{
'nr1' => '8',
'xnr' => '3338757522',
'dev' => 'OUT',
'time' => '08:33:48',
'date' => '2014-04-08',
'well' => 'unknown',
'lastnr' => '459687',
'nr3' => '3338757522',
'nr2' => '21',
'lfdnr' => '3935'
},
{
'nr1' => '34',
'xnr' => '3338700192',
'dev' => 'OUT',
'time' => '08:13:34',
'date' => '2014-04-08',
'well' => 'unknown',
'lastnr' => '703553',
'nr3' => '3338700192',
'nr2' => '61',
'lfdnr' => '3965'
}
];
Prozess erfolgreich beendet.