Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey guys,
I am new to QlikView.
I like to read Data from a .txt file. It works for the normal reading.
But in the .txt file, there are 4 blocks of data.
I just need the first block. The blocks are separated by an empty row.
I found the command for removing an empty row but I need to delete all rows after that empty row.
Further, I want to read in as many .txt files as there are in a folder.
Please help me with this or give me a hint where I can look up those information.
Thanks,
Henrik
Please share sample file with expected output
Hi,
For each vFileName in Filelist ('C:\Path\*.txt')
Load *,
'$(vFileName)' as FileName
From [$(vFileName)];
Next vFileName
The file looks like this:
==================
[Common_Data]
Data1;abc
Data2;def
Data3;ghi
[Data_Table1]
time(s);temp(°C);pressure(bar);....
5;40;10;.....
10;41;11;.....
15;39;14;.....
[Data_Table2]
time(s);temp(°C);pressure(bar);....
5;34;2;.....
10;35;3,5;.....
15;39;4;.....
===================
I jump over (header=6 rows) the "[Common_Data]" and begin the load with "time(s);..." from "[Data_Table1]" as fieldnames.
Then I only want to read the values of "[Data_Table1]". The Load should stop, when the first empty row is reached. In the example it's the row above "[Data_Table2]".
Hi,
maybe one solution could be:
LOAD *, RangeSum([time(s)] like '
Inline "
[Common_Data]
Data1;abc
Data2;def
Data3;ghi
[Data_Table1]
time(s);temp(°C);pressure(bar);....
5;40;10;.....
10;41;11;.....
15;39;14;.....
[Data_Table2]
time(s);temp(°C);pressure(bar);....
5;34;2;.....
10;35;3,5;.....
15;39;4;.....
" (header is 5 lines, delimiter is ';');
Right Join LOAD 0 as HeaderLine AutoGenerate 1;
hope this helps
regards
Marco