1
2
3
4
5
6
@Array = <iFile>; # Copy File 2 Array
@Array = grep {$_ =~ /^GO./}@Array; # Select all lines starting with GO
while (@Array){
@Array1 = splice(@Array,2); # Drop first two colums
}
1
2
GI$164 T0c7 6814 1 20140406 235955 0 0 1 d45bfa6a 1 1 1 10A 3 15756207511 3 15756207511 0 1 3 821784727144711 000 0 3 0000821784727144711 1 78 B11 CHAT_DEF 132242-255636 SS7_TCOM_30_1 loop[gw_sip,me-vgw30-ep] 0 D00c 7520 312acb G021 20140406 23595598 ? ? 0000000019 E007 020100 V013 8 20 0 0 0 SIP_OUT Z032 12733-OI-056b64dc-4e1bcb745@sip.berlin.dns-net.de
GI$175 T0b7 5196 1 20140406 235913 0 44 44 d45bfa6a 1 256 1 00A 3 3391651071 3 3391651071 0 1 3 3391650482 001 0 3 3391650482 1 24 F10 XX 132308-255620 SS7_TCOM_30_1 SIP[sip.berlin.dns-net.de] 0 D00c 7520 312abf G02a 20140406 23591308 0000000043 ? 0000004433 E007 020103 V013 8 20 0 1 0 SIP_OUT V013 8 20 0 1 0 SIP_OUT Z032 12512-NE-056b624e-4b167b315@sip.berlin.dns-net.de
2014-04-08T06:42:16 cohama
1
2
3
4
splice ARRAY,OFFSET,LENGTH,LIST
splice ARRAY,OFFSET,LENGTH
splice ARRAY,OFFSET
splice ARRAY
1
2
3
4
5
6
7
@Array = <iFile>; # Copy File 2 Array
@Array = grep {$_ =~ /^GO./}@Array; # Select all lines starting with GO
while (@Array){
@Array1 = splice @Array,0,2; # Drop first two colums
push @Array2,@Array1;
}
print oFile @Array2;
use strict;
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
#!/usr/bin/perl -w
########################
# Modul Definition
#########################
use strict;
##########################
# Parameter Definition
#########################
my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst);
my($date,$clock);
my ($File1,$File2);
my (@Array,@Array1,@Array2);
my $item;
##########################
##########################
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 = "./log/grnti";
$File2 = "./log/".$date."_Result.log";
if ( -e $File1 ){
open (iFile,"<$File1") || die $!;
open (oFile,">$File2") || die $!;
}
@Array = <iFile>; # Copy File 2 Array
@Array = grep {$_ =~ /^GO./}@Array; # Select all lines starting with GO
while (@Array){
@Array1 = splice(@Array,0,2); # Drop first two colums
@Array1 = sprintf("%4s %4s",@Array1);
push @Array2,@Array1;
}
print oFile @Array2;
close(iFile);
close(oFile);
@Array1 = splice(@Array,0,2); # Drop first two colums