Judging by the way the requirements have evolved and by OP's Re^2: Oracle report converter reply in his other relate thread, so far we have only seen the very tip of the iceberg - there is a lot more to come. Palming the OP off with a bunch of regexen solves a short term problem in a "look what I can do" fashion, but doesn't seem to be helping the OP very much at present and will lead to a maintenance nightmare for him in the longer term.
It is hard to know what the OP's motivation for this task is, but leading him along by offering tempting morsels that will either frustrate the OP because they don't provide all of the solution, or transfer a large development project over to PerlMonks, is unlikely to get the OP to a satisfactory endpoint. In fact, that's just sadistic. Much better to be up front and say "That's a big job. Here's the tool for it." and let the OP figure out sooner rather than later that either he's not up to it, or that some serious learning needs to be done. The nice thing is that this is a pretty good place to do a lot of that learning, or at least to get a lot of guidance toward appropriate learning resources.
DWIM is Perl's answer to Gödel
| [reply] |
Palming the OP off with a bunch of regexen solves a short term problem ... and will lead to a maintenance nightmare for him in the longer term.
Recursive Descent Parsers are great for recursive grammers, but this is self-evidently not a recursive grammar.
You have heard of Practical Extraction and Reporting Language perhaps? Yes, I know its a backronym, but this is bread & butter Perl usage. This is why the every other scripting language advertises itself as having a Perl Compatible Regex Engine.
... or transfer a large development project over to PerlMonks, ...
And you think that he isn't going to need help with P::RD? And isn't going to come back to PM for it?
If you are not interested in helping the guy, rather than preaching at him, move on. Somebody else will come along and be only too happy to help him. CountZero already posted a fairly comprehensive solution before you replied.
... he's not up to it, ...
Maybe he's not, but is that your call?
The nice thing is that this is a pretty good place to do a lot of that learning, or at least to get a lot of guidance toward appropriate learning resources.
I agree, but there is far greater pool of expertise in regex here than in P::RD. And given the OPs apparent expertise level, it will be far easier to educate him in the use of regex than P::RD, which requires a pretty full understanding of context free grammers to even get started. Not to mention that all but the most simple P::RD grammars seem require some use of regex, so he'd have to get to understand them anyway.
It seems his problem isn't likely to go away anytime soon:
Questioner: Dear all... I am willing to listen/read any advise at all. Maybe there
are tools out there that can help with this. If you know any please let me
know.
Reply: ... if that is really RPT/RPF, just throw away your programs.
Signature: ***** ****** Senior Oracle DBA.
... in a "look what I can do" fashion, but doesn't seem to be helping the OP very much at present ...
Ah! The crux. I am at least willing to try and help the guy help himself--though I'm asking him to make some effort--not just judge him as incompetent and "palm him off" with a pat PC reply.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] |