vadiraj_nk has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks, I want to convert strings into expressions which I can use in Perl script to look for pattern match. Assume that there is an input file having multiple text strings. Each string is begins with sub-heading followed by a string. I need to parse this input file and then generate hash array containing key as “sub-heading” and value as “expression”. If I manually convert first sub-heading and followed text into a has entry then it would be…
Input File: --------------------------“Cause” => “^\<\d\>\[\s+[0-9]*\.[0-9]*\]\s+(\w+)\s+Unable\sto\shandle +\skernel\s((\w+)\s)*at\svirtual\s address\s(\w+)”
-------------------------- Please help in scripting this. Thanks, VadirajCause: <1>[ 221.631896] c1 Unable to handle kernel NULL pointer dereference +at virtual address 000003d0 Message: <0>[ 221.721038] c1 Kernel panic - not syncing: Fatal exception CPU Info: <4>[ 221.635192] c1 CPU: 1 Not tainted (3.4.5-1368373 #1)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Convert strings into Perl expression
by wjw (Priest) on Jun 11, 2014 at 06:58 UTC | |
|
Re: Convert strings into Perl expression
by Anonymous Monk on Jun 11, 2014 at 06:59 UTC |