Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
profilejamesbond

2 delimiters data source file (Tab and Semicolon seperated file)

Hi,

I have a text file that contains multiple columns. Some columns are seperated via tab space and some columns are seperated via semicolon ;.

 

one time -> delimiter is '\t'

one time -> delimiter is ';'

 

The problem is when I load the file then the Qlik asked me that how do you want to load the file means how do you want to split the columns ? So, I load the file two times to accomplish the data load. One time I have to split data load file with editor with tab seperation and one time load with semicolon column seperation.

 

Available file example: Country        State        Product;Price;Date

 

Now, I want to load the file in one load and wants to fix this load delimators.

Any suggestion?

 

Thanks

 

 

Labels (4)
3 Replies
profilejamesbond
Author

Looks like to load the data with tab delimiter and use SubField to seperate Semicolon delimiter data.

gomeri
Partner - Creator
Partner - Creator

Hi,

I recommend to use if conditions together combined with subfield function. 

Check out this article and let me know if it helps you:

Solved: How to use Sub-field Function for Multiple Delimit... - Qlik Community - 1296244

 

Thanks

Giovanni O. D.
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

In order to parse the column names correctly, I suggesting loading the file as fixed, replace the tabs with semicolons, store it out and read it again using semicolon delim. You will also skip the extra first line on the second read. Like this:

Data:
LOAD
replace("@1:n", chr(09), ';') as data
FROM [lib://qlikdata/Source.txt]
(fix, codepage is 28591, no labels);

Store Data into [lib://qlikdata/ModifiedSource.txt] (txt);
Drop Table Data;

Data:
LOAD
F1,
F2,
F3,
F4
FROM [lib://qlikdata/ModifiedSource.txt]
(txt, utf8, embedded labels, delimiter is ';', no quotes, header is 1 lines);

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com