#!/usr/bin/perl; use strict; use warnings; use Getopt::Long; my @ARRAY = (); my $ARRAYlength = -1; my $FILEname="/var/log/logfile.txt"; open FILE, $FILEname or die "couldn't open $FILEname: $!"; while (<FILE>) { @ARRAY = <FILE>; print "@ARRAY\n" } close FILE or die "problems closing $FILEname: $!";,<
Output of above script: **FAILED PROD** - BUGS - 08/26/13 @11:12 - BUGS~23AUG13~23AUG13~23AUG13~26AUG13~1109
**FAILED PROD** - cockroach - 08/29/13 @11:52 -cockroach~29AUG13~29AUG13~29AUG13~29AUG13~1152
Iam able to read the logfile lines into array and at this point I want to split components of each line and check the time and alert if it is between 18hrs to 6AM following day.
In reply to Re^2: How to read each line of file into an array and split contnts of each line into array cells
by crazy-duck
in thread How to read each line of file into an array and split contnts of each line into array cells
by crazy-duck
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |