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!
Hi
Is this a file in the folder containing the csvs you are loading? But the file list should only match *.csv files.
Is that a script error? Maybe a screen shot would help.
You can debug your script and.or add a trace statement in the line after the For Each...FileList() line to see what you are getting in the variable File:
TRACE File = $(File);
Regards
Jonathan
Hi,
I added trace , but it did not help and does not show me the value at all.
Prtscr is attached.
Thanks for help!!!
Hi,
I fixed a problem. Everything works. Thanks a lot!!!!
Please post how you solved the problem, because it may help someone else with a similar problem.
Jonathan
Hi, here it is :
SET FilePath='*.csv';
set vFileName = 'file';
for each File in filelist ('C:\Users\innas\Desktop\Qvd\QV_new\daily\' & FilePath)
TRACE File = $(File);
SET sFile = '$(File)';
Directory;
NetworkDomainDailyData:
LOAD *
FROM
[$(sFile)]
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
store * from NetworkDomainDailyData into C:\Users\innas\Desktop\Qvd\Sql_Data\$(vFileName).qvd(qvd);
drop table NetworkDomainDailyData;
next File