Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
MElsad
Contributor
Contributor

Formating a txt-file to table structure

Hello,

Lets say i have a txt file that looks like this

"a":"1", "b":"2", "c":"3" and so on

How do i get this to be a table like this?

a,b,c

1,2,3

If i just load the txt file then the column names will be "a":"1" and no field values

 

Labels (1)
1 Reply
sandeep-singh
Creator II
Creator II

Try this

I have created a text file with data as "a":"1", "b":"2", "c":"3"

Dummy:
LOAD
@1
FROM [lib://Data/file.txt]
(txt, codepage is 28591, no labels, delimiter is ';', msq);


Test:
load Distinct
SubField(fieldname,':',1) as Dim,
SubField(fieldname,':',2) as Val,
;
load Distinct
SubField(PurgeChar(@1,'"'),',') as fieldname
Resident Dummy;


drop Table Dummy;