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

read files from one folder to another folder

Hi,

I want to read files from one folder and move to another folder but following script is not giving the desired output after execution of the script(see image below)

Untitled.png
let FilePath = [D:\Qlik_OrderSheets\final_order];
let vFilPathProceed =[D:\Qlik_OrderSheets\OrderSheets]
Full_Order_Data:

LOAD distinct Plant, 
OrderNo, 
OrderDate, 
OrderType, 
DistChannel, 
Division, 
NCODE, 
Season, 
MatType, 
Style, 
Color, 
Size, 
OrderQty, 
OrderValue, 
ConfirmedQty, 
ConfirmedValue, 
MRP
FROM
[D:\Qlik_OrderSheets\OrderSheets\QLIK*.CSV]
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
Execute cmd.exe /C Move $(FilePath) $(vFilPathProceed);

17 Replies
pradosh_thakur
Master II
Master II

This one as well as
go to edit script(ctrl+e) then in the bottom where there is odbc connection etc are there you can see a setting tab-> can execute external programs is checked.
Learning never stops.
sakshikaul
Creator II
Creator II
Author

Its not working after i checked this "can execute external programs"

so I am trying without variable so this will be the syntax right?

FROM
[D:\Qlik_OrderSheets\OrderSheets\QLIK*.CSV]
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
//store Full_Order_Data into D:\Qlik_OrderSheets\final_order.qvd;
Execute cmd.exe /C Move [D:\Qlik_OrderSheets\OrderSheets] [D:\Qlik_OrderSheets\final_order];

 

pradosh_thakur
Master II
Master II

Include them in double quotes and I think you are missing the file names in the source folder.
Learning never stops.
pradosh_thakur
Master II
Master II

Execute cmd.exe /C Move "D:\Qlik_OrderSheets\OrderSheets\QLIK*.CSV" "D:\Qlik_OrderSheets\final_order";
Learning never stops.
pradosh_thakur
Master II
Master II

Did you get it working ?
Learning never stops.
sakshikaul
Creator II
Creator II
Author

Hi

I want to implement increment load and for that I have several csv files which are provided to me on daily basis in a given following folder (OrderSheets ) and now that files should be read from that folder(Order_sheets) and then stored in qvd one by one after reading and then move to a different folder after saved in qvd (final_order)(refer image below)

Untitled.png

once the entire process is done the files saved in QVD after reading should be then overwritten in Full Load (Please refer Code Below) 

Full_Order_Data:

LOAD distinct Plant,
OrderNo,
OrderDate,
OrderType,
DistChannel,
Division,
NCODE,
Season,
MatType,
Style,
Color,
Size,
OrderQty,
OrderValue,
ConfirmedQty,
ConfirmedValue,
MRP
FROM
[D:\Qlik_OrderSheets\OrderSheets\QLIK*.CSV]
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);

store Full_Order_Data into D:\Qlik_OrderSheets\final_order.qvd;
Execute cmd.exe /C Move "D:\Qlik_OrderSheets\OrderSheets\QLIK*" "D:\Qlik_OrderSheets\final_order";
Full_Order_Data:

LOAD Plant,
OrderNo,
OrderDate,
OrderType,
DistChannel,
Division,
NCODE,
Season,
MatType,
Style,
Color,
Size,
OrderQty,
OrderValue,
ConfirmedQty,
ConfirmedValue,
MRP
FROM
[D:\Qlik_OrderSheets\final_order\QLIK*.CSV]
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);

//////////////////Full Load Order///////////////////////////////
concatenate(Full_Order_Data)
LOAD distinct Plant,
OrderNo,
OrderDate,
OrderType,
DistChannel,
Division,
NCODE,
Season,
MatType,
Style,
Color,
Size,
OrderQty,
OrderValue,
ConfirmedQty,
ConfirmedValue,
MRP
FROM
[D:\Qlik_OrderSheets\OrderSheets\Full_Order_Data.qvd]
(qvd)
where not exists(NCODE, Style&Color&Size);

store Full_Order_Data into C:\Users\dmsadmin\Desktop\New folder\QVD\extract_qvd\Full_Order_Data.qvd;
drop table Full_Order_Data;

pradosh_thakur
Master II
Master II

what is the issue now ? Are the file getting transferred or not ?
Learning never stops.
sakshikaul
Creator II
Creator II
Author

yes. Thanks