Perl Split on a Long Sentence Question

B

Brian Wilkins

I am trying to split a session log into meaningful data for regression
testing. The session log is defined as follows:

[ 1] Memory Leak Exiting Program: Address 0x0F701E90 (128) allocated
by HeapAlloc., Interesting Location: WpjData.dll ! 0x00013279

This information is similarly repeated over several lines for each DLL
that leaked.

The information I want to preserve is

"Memory Leak Exiting Program"

"Address 0x0F701E90"

"128"

"HeapAlloc"

"WpjData.dll ! 0x000013279"

All other information on the line is extraneous. Any clue as to how I
should parse this? I'm trying to find an appropriate pattern.

Thanks.
 
U

usenet

Brian said:
All other information on the line is extraneous. Any clue as to how I
should parse this? I'm trying to find an appropriate pattern.

You probably won't be able to find such a pattern - you will need to
write your own. You may wish to consult:

perldoc perlre

If you have trouble with your efforts, feel free to post your code for
review and comment.
 
A

anno4000

Brian Wilkins said:
I am trying to split a session log into meaningful data for regression
testing. The session log is defined as follows:

[ 1] Memory Leak Exiting Program: Address 0x0F701E90 (128) allocated
by HeapAlloc., Interesting Location: WpjData.dll ! 0x00013279

This information is similarly repeated over several lines for each DLL
that leaked.

The information I want to preserve is

"Memory Leak Exiting Program"

"Address 0x0F701E90"

"128"

"HeapAlloc"

"WpjData.dll ! 0x000013279"

All other information on the line is extraneous. Any clue as to how I
should parse this? I'm trying to find an appropriate pattern.

What have you tried?

We help people fix their programs, but we don't deliver according
to specification.

Speaking of which, a single example without a word how the data
varies from case to case is useless as a specification. Far less
is it a definition.

Anno
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top