Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello!
I need to load and read all LOG files from a directory and then extract those lines that have a FROM clause.
Do you know how could I do this?
Thank you!
You can use "File Wizard" to achieve the same.
1. 'Edit Script' ----> 'Table Files'
2. Select the log file you want to query
3. Choose how you want to delimit your data. ' Click Next'
4. Click 'Enable Transformation Step'
5. 'Conditional Delete' under 'Garbage Tab'
You can play around from here.
Hi,
Try like this
LOAD *
FROM
*.txt
(txt, codepage is 1252, no labels, delimiter is '\t', msq)
where Field>0;
Regards
ASHFAQ
I don't know exactly the result you would obtain, but you can
MyTab:
add LOAD *
FROM
*.txt
(txt, codepage is 1252, delimiter is '\t', msq)
where Field like '*From*';
How to use regular expressions
Hope this helps
Assuming you want to parse QV document logs, there may be no single method to do this. AFAIK a FROM keyword may be present on a line by itself (standard QV formatting) or it may be followed by a filename and options.
Are you trying to lift the data sources from a document log?.
Yes, I need to extract all the inputs that are used in a QVW...
Do you know a practical way to do it?
Thanks.
No, not really. And that's for a very simple reason: QlikView script uses a language with a non-context free grammar, meaning that in order to obtain the meaning of a particular "FROM" you'll have to know the context of this particular FROM. For example, this is a valid script statement:
SET FROM = LOAD;
SET "Other FROM" = LOAD;
FROM :
$(FROM) $(Other FROM), FROM
FROM
FROM
(txt)
;
Which FROM do you want to select?.
On the other hand, if you can be sure that a particular statement format is used for all LOAD statements, then there are possibilities. For example, if the name "FROM" is never used for anything else that the FROM clause, and FROM and source path always appear on the same line, then the log parsing becomes fairly straightforward, even in a QV script.
Peter