Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
felcar2013
Partner - Creator III
Partner - Creator III

qlikview does not read header of txt file correclty

hi

i want to Import a txt file, but the Header breaks to the 2nd line. Is this is a qlikview Problem or the txt file has somehow a break line? how can i solve this?

thanks

importwizard.png

6 Replies
Not applicable

Can you attach that sample file if possible. Looks like a problem with the file.

felcar2013
Partner - Creator III
Partner - Creator III
Author

HI

the file is too big to open it in Notepad++ and i cannot attach the file. It was a semicolon delimited text file, and the break is exactly at the "WHITE" Level Name, as shown in the wizard

it really seems that is a Problem with the file

MarcoWedel

then don't use embedded labels but name your fields like

load

     @1 as fieldname

...

from yourcsvfile.csv

...

;

Not applicable

Maybe you can choose Header Size > Line as 2 then, it will pick the second row as header. Then you will have to go and rename the fields individually.

Like based on your example,

Load

White as Field1,

Contact_optin_freepack as Field2,

............

felcar2013
Partner - Creator III
Partner - Creator III
Author

good Option i try this

thanks

MarcoWedel

Hi,

another solution to rename the fields with the concatenated values of the top 2 rows:

LET vHeaderRows = 2;

tabColsTemp:

CrossTable (ColNam, ColNamNew)

LOAD RecNo() as RecNo,

    *

FROM

(txt, codepage is 1252, no labels, delimiter is ',', msq)

Where RecNo() <= $(vHeaderRows);

tabCols:

Mapping LOAD

  ColNam,

  Concat(ColNamNew, ' ', RecNo) as ColNamNew

Resident tabColsTemp

Group By ColNam;

DROP Table tabColsTemp;

table1:

LOAD *

FROM

(txt, codepage is 1252, no labels, delimiter is ',', msq, header is $(vHeaderRows) lines);

RENAME Fields using tabCols;

use the variable vHeaderRows to define the number of rows that hold the field names.

QlikCommunity_Thread_129996_Pic1.JPG.jpg

input:

QlikCommunity_Thread_129996_Pic2.JPG.jpg

hope this helps

regards

Marco