Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Data loaded from text file appears jumbled up

I am attempting to load data from a text file where the delimiter is '|'

My load statement is

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

When the data is loaded though records are jumbled up so for instance you will see sales regions appearing under sales manager.

I have tried both standard and no quotes to no avail. Also checked specific lines using rowNo and a text editor but can't spot anything visible.

I believe this topic has been raised but no resolution was offered.

Thanks

37 Replies
Not applicable
Author

Hi in answer to your questions :

Yes

Yes

Not sure how to verify

sasiparupudi1
Master III
Master III

Does it get loaded fine in other applications like excel?

Not applicable
Author

Yes seems to work ok in excel ( using a small extract of data ) but not csv or txt.

Not applicable
Author

Sorry correction - no does not work in excel either

sasiparupudi1
Master III
Master III

Sorry I did not get you

Not applicable
Author

Just to clarify - It does not load fine in other applications ie excel

Ralf-Narfeldt
Employee
Employee

One method of dealing with troublesome textfiles is to load them as fixed record files without specifying field breaks. Each record will then contain a single field holding the entire row.

The next step is to use the SubField() function, using the | delimiter, in a resident load to split up the data in fields. Hopefully you'll be able to load most data this way. If you have isolated the problem you may be able to do some damage control here on the problem rows as well.

You will need to specify each field (field1, field2...) of course

RawData:

LOAD @1:n as raw

FROM [your_file]

(fix, codepage is 1252, no labels);

Data:

Load

SubField(raw, '|', 1) As field1,

SubField(raw, '|', 2) As field2,

...

Resident RawData;

vlad_komarov
Partner - Specialist III
Partner - Specialist III

You probably have a missing '|' field separator somewhere in your records.

I know it's very annoying to debug this kind of issues, but you can load whole line from the text file as one text field and calculate a number of '|' characters in each one of them.

The string(s) with anomaly (with the number of separators less than usual) should be pointed out easily.

Regards,

Vladimir

Not applicable
Author

Hi So I checked this but the offending lines do in fact have the same number of separators

Not applicable
Author

Also if I load the offending line on it's own with just the header row it loads fine. It's as if the structure of the file itself is what's causing the problem