Skip to main content
Announcements
Marching toward a simplified navigation! READ ON
cancel
Showing results for 
Search instead for 
Did you mean: 
nachiket_shinde
Contributor III
Contributor III

Load multiple QVDS from a Folder one by one and store in other folder

Hello Friends,

 

    I have few QVDs(number not defined) in folder with following format:

test_05032018

test_06032018

test_07032018

test_08032018

I have to take each file one by one , make few changes and store with same name in another folder/same folder.

 

Thanks in advance

 

 

3 Replies
mrybalko
Creator II
Creator II

Hello @nachiket_shinde 

Try the following code:

SET vInputFolder = Input;
SET vOutputFolder = Output;

FOR Each vCurFile in FileList('$(vInputFolder)\test_*.qvd')

	LET vCurFileName = SubField(vCurFile, '$(vInputFolder)\', 2);
	
	tmp:
	LOAD
		*
	From [$(vCurFile)] (qvd);
	
	STORE tmp into '$(vOutputFolder)\$(vCurFileName)' (qvd);
	
	DROP Table tmp;

NEXT //FOR Each vCurFile in FileList('$(vInputFolder)\test_*.qvd')
nachiket_shinde
Contributor III
Contributor III
Author

What if QVDs have different number of columns?

mrybalko
Creator II
Creator II

When you use LOAD * construction it doesn't matter.