Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

List of Text Files in a Folder to convert to QVD's

Hi

I have a list of text files in a folder that i want to convert to QVD's.  Every week a new text file is added to the folder.  How do i create a script to convert all files into QVD's

Below is the sample list of the current text files

Survey_Data_20180108

Survey_Data_20180101

Survey_Data_20171225

Survey_Data_20171218

Survey_Data_20171120

Survey_Data_20171106

Survey_Data_20171002

Survey_Data_20170926

Survey_Data_20170919

Kind regards,

Nayan

3 Replies
zhadrakas
Specialist II
Specialist II

i did not tested this script. But this should help you to get started

FOR EACH file in filelist('D:\YOUR_PATH\*.txt') ;

tmp:
LOAD *
FROM $(file)
(
txt, codepage is 1252, no labels, delimiter is '\t', msq);

let QVDPath = left('$(file)', len('$(file)')-3) & 'qvd';

Store * from tmp into '$(QVDPath)' (qvd);

NEXT file

Anonymous
Not applicable
Author

Hi Tim

Thank you for your reply.  I have applied your script, however I get the following error.

Kind regards

Nayan

Capture.JPG

zhadrakas
Specialist II
Specialist II

try to add the trace command to see what happens

please Show me the result.

Probably there is something wrong with the path.

FOR EACH file in filelist('D:\YOUR_PATH\*.txt') ;
TRACE '$(file )';
tmp:
LOAD *
FROM $(file)
(
txt, codepage is 1252, no labels, delimiter is '\t', msq);

let QVDPath = left('$(file)', len('$(file)')-3) & 'qvd';

Store * from tmp into '$(QVDPath)' (qvd);

NEXT file