Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How can I remove all rows after an empty one?

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

5 Replies
Kushal_Chawda

Please share sample file with expected output

el_aprendiz111
Specialist
Specialist

Hi,

   For each vFileName in Filelist ('C:\Path\*.txt')

      Load *,

'$(vFileName)' as FileName

      From [$(vFileName)];

   Next vFileName

Anonymous
Not applicable
Author

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]".

MarcoWedel

Hi,

maybe one solution could be:

LOAD *, RangeSum([time(s)] like '

  • ',Peek(HeaderLine)) as HeaderLine
  • 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