#!/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 = ; # 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);