Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all,
Will appreciate your help and advice...
I'm loading all excel files located in directory 'c:\temp', using the below code:
Directory C:\temp\
set filectr=0;
For each ExcelFile in filelist ('*.xls')
If filectr=0 then
temp_xls_files:
Load Date1 as sign_date,
cellnum,
cust_name
from $(ExcelFile) (biff, embedded labels, header is 1 lines, table is Sheet1$);
Else
temp_xls_files:
Concatenate
Load Date1 as sign_date,
cellnum,
cust_name
from $(ExcelFile) (biff, embedded labels, header is 1 lines, table is Sheet1$);
EndIf
Let filectr=$(filectr)+1;
next ExcelFile
now, I would like to load more files (in the same format) but from additional directory - c:\temp1.
when I'm duplicating the code to load from c:\temp1, QV creats Synthetic keys for each field.
My question is, how can i use the above code to load all excel files from several directories ?
Thanks in advanced.
David
Hello David,
I hope you are not using the if part for the second directory. Just concatenate is enough.
Regards,
Kiran.
Hello David,
I hope you are not using the if part for the second directory. Just concatenate is enough.
Regards,
Kiran.
You're right...I've eliminated the if and it works ok.
Thanks Kiran for your advise,
David