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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Qlik_William
Contributor III
Contributor III

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;