in reply to Perl beginner here, needs a shove in the right direction.
G'day rfromp,
Welcome to the Monastery.
Based on your command line solution, here's some pointers.
Firstly, take a look at Re^3: Opening multiple log files. I wrote that a couple of days ago. Change .log to .TXT to get your *.TXT files.
Then open each in turn and read line-by-line. See perlintro: Files and I/O; follow the links in that section for more details.
Check each line for /uniqueKeywordAtBeginningOfLine/. You'll want to anchor your regex to the start of the line. See perlintro: Regular expressions; follow the links in that section for more details.
When you get a match, use split and an array slice for the three wanted fields (i.e. to emulate cut -f 6,7,8 -d '/'). See perlintro: Perl variable types; follow the links in that section for more details.
Now perform whatever checks you need on those fields. You may want to write the results to some log file for subsequent analysis.
If you need further help, please address individual issues with a short piece of code that illustrates your problem. Do not post propriety data: make up dummy data. All of this is explained in How do I post a question effectively?.
-- Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl beginner here, needs a shove in the right direction.
by rfromp (Novice) on Jun 16, 2015 at 21:22 UTC |