Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I've got a log file that I'm trying to process. The start of each new record is "Number of executions" and the last field is "Statement text". Unfortunately this Statement text may extend to several lines but I want everything after "Statement text =" to be loaded in to a single field. I've tried several different things but have not found a solution. Is this possible?
I guess I figured out now. It was missing because of the text delimiter =.
Did you try this?
Just a rough sketch,
Peter
I was hoping for something simple but did have some thoughts along these lines (though not an idea as fully formed as this). I don't think I can use the "=" (equal sign) though as any kind of delimiter or matching text as it may appear in the Statement text.
Yes you can use the equal sign as a delimiter. There are three conditions that must be met in order to detect a valid parameter line:
IMHO text that matches these conditions cannot be mistaken for legal SQL, not even part of it. Thank god for those verbose keywords.
Processing all these conditions in every column creation code won't be simple however. But then, QlikView is not really a parsing engine...
Hi
PFA,I hope it help to you
The coding is brilliant, but how do we link the records together so for example we know which "Number of executions" goes with which "Statement text"?
Hi,
Please paste sample output how you want ?
Just assign a counter to every record, whose value only increases upon encountering the next line with keyword "Number of executions". It seems that this keyword is always the first. In this way you'll be counting parameter blocks and reinserting the "Statement text" will be easy.
There is an example of such a numbering in this thread: Numbering Rows more examples?
Well basically each fieldname to the left of the "=" sign will become a header. i.e.
I've just put a few fields as a quick example.
Hi Shane,
See the script attached.
Regards,
David