I am trying to get certain information from .LOG files
currently running this which when i execute it to CMD it spams my screen of everything it reads from the array.
#!/usr/bin/perl
use strict;
open(MYINPUTFILE, "<03290232.LOG");# open for input
my(@lines) = <MYINPUTFILE>; # read file into list
@lines = sort(@lines); # sort the list
my($line);
foreach $line (@lines) # loop thru list
{ print "$line"; # print in sort order
}
close(MYINPUTFILE);
attached is the file i'm looking to grab specific text from but i'm not 100% sure how to go about doing it... I've read alot about scalars and parsing text and arrays to output files etc.
But what i want to do is create an output.txt file
that stores the specific text onto it.
PeopleNet PACOS event from device ####: Trip: ######### arrived at stop 1
General Processing .....
General Driver:
General Invalid PACOS Event
as well as the date.
currently running this which when i execute it to CMD it spams my screen of everything it reads from the array.
#!/usr/bin/perl
use strict;
open(MYINPUTFILE, "<03290232.LOG");# open for input
my(@lines) = <MYINPUTFILE>; # read file into list
@lines = sort(@lines); # sort the list
my($line);
foreach $line (@lines) # loop thru list
{ print "$line"; # print in sort order
}
close(MYINPUTFILE);
attached is the file i'm looking to grab specific text from but i'm not 100% sure how to go about doing it... I've read alot about scalars and parsing text and arrays to output files etc.
But what i want to do is create an output.txt file
that stores the specific text onto it.
PeopleNet PACOS event from device ####: Trip: ######### arrived at stop 1
General Processing .....
General Driver:
General Invalid PACOS Event
as well as the date.