Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
Hello all,
I have monthly csvs(24 csvs with monthly names) in one folder, which I have to load to appropriate monthly qvds.
I want to make a loop of loading these csvs.
Can anybody help me to build a procedure which loads csvs in a loop to qvds with the same names like csvs?
Thanks a lot!
 
					
				
		
 jonathandienst
		
			jonathandienst
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi
This line is wrong:
for each File in filelist (C:\Users\innas\Desktop\Qvd\QV_new\daily\ &'\'&'$(FilePath)')
Change it to this:
for each File in filelist ('C:\Users\innas\Desktop\Qvd\QV_new\daily\' & FilePath)
You also do not need this line:
SET sFile = '$(File)';
Just use File where you were using sFile.
Hope that helps
Jonathan
 
					
				
		
 rajni_batra
		
			rajni_batra
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		FOR i = 1 to 12
LET vFileName = 'file' & '$(i)' & '.csv' ;
sales_table:
LOAD ....
FROM $(vFileName) (ansi, fix, no labels, header is 0, record is line) ;
NEXT
or some thing like this...
 
					
				
		
ok, I understood. But how do I do store to (?)qvd?How I make dynamic name to qvd?
 
					
				
		
 rajni_batra
		
			rajni_batra
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		not possible because as per my understanding all fields name are same so they will get concate automatically.
will get store in a single QVD only....
u can add a flag by using filename() or filebasename()
hope to help!!!! 
 
					
				
		
Thanks a lot!!!
 
					
				
		
Hi,
I am trying to do the following:
SET
 ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep=',';
SET MoneyDecimalSep='.';
SET MoneyFormat='$#,##0.00;($#,##0.00)';
SET TimeFormat='h:mm:ss TT';
SET DateFormat='M/D/YYYY';
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';
SET FilePath='*.csv';
set vFileName = 'file';
for each File in filelist (C:\Users\innas\Desktop\Qvd\QV_new\daily\ &'\'&'$(FilePath)')
    SET sFile = '$(File)';
    Directory;
   NetworkDomainDailyData:
    LOAD *
    FROM
    [$(sFile)]
    (fix, codepage is 1252);
 
store * from NetworkDomainDailyData into C:\Users\innas\Desktop\Qvd\Sql_Data\$(vFileName).qvd(qvd);
drop table NetworkDomainDailyData;
    next File
    
    exit script;
 and it does not load/store anything.
Where is my mistake?
 
					
				
		
 rajni_batra
		
			rajni_batra
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		can u share the name of ur .csv files so that i could try it
 
					
				
		
Hi,
one of the csv files look like:
C:\Users\innas\Desktop\Qvd\QV_new\daily\ra_daily.csv
Thanks!!!
 
					
				
		
 jonathandienst
		
			jonathandienst
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi
This line is wrong:
for each File in filelist (C:\Users\innas\Desktop\Qvd\QV_new\daily\ &'\'&'$(FilePath)')
Change it to this:
for each File in filelist ('C:\Users\innas\Desktop\Qvd\QV_new\daily\' & FilePath)
You also do not need this line:
SET sFile = '$(File)';
Just use File where you were using sFile.
Hope that helps
Jonathan
 
					
				
		
Hi Jonathan,
your answer helped very much.
But now while loading I am getting the following error:
Error: File .\extdata.cpp, Line 2788
What can it be?
Thanks.
