Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
my data are in this location i have to load all the date at a time
[..\Data Source\28-Jan-2016\NT\Change_in_Book_and_Market_Value_28-01-16.XLS]
[..\Data Source\29-Jan-2016\NT\Change_in_Book_and_Market_Value_29-01-16.XLS]
[..\Data Source\01-Feb-2016\NT\Change_in_Book_and_Market_Value_01-02-16.XLS]
[..\Data Source\02-Feb-2016\NT\Change_in_Book_and_Market_Value_02-02-16.XLS]
can u hlep me please
Try to use below script.
for i = num(date#(vStartDate, 'DD-MM-YYYY')) to vEndDate
let vTemp = text(date($(i), 'DD-MMM-YYYY'));
if not (WeekDay(date($(i))) = 'Sat' or WeekDay(date($(i))) = 'Sun') then
LOAD
ID,
Type,
Data
FROM
[..\Data Source\$(vTemp)\NT\*.XLS]
(ooxml, embedded labels, table is Sheet1);
ENDIF
next
Could you please share the script?
Hi,
If you wanted load all these excels at a time then please create a folder and from there you can just load all excels as per name.
ie., something like this.
[\Data Source\NT\Change_in_Book_and_Market_Value_*.xls
pradip to be frank i cannot share the script and i have a folder called data source in it the files are sepreated by date as folder name. inside Date folder i have a folder called NT in all the folders.Inside the NT folder i have my file which i have to load at a time
Try like
for i = num(date#(vStartDate, 'DD-MM-YYYY')) to num(date#(vEndDate, 'DD-MM-YYYY'))
let vTemp = text(date($(i), 'DD-MMM-YYYY'));
LOAD
ID,
Type,
Data
FROM
[..\Data Source\$(vTemp)\NT\*.XLS]
(ooxml, embedded labels, table is Sheet1);
next
As your forder names consist of date , take input of Minimum Date and Maximum Date from front end. Here vStartDate consists of Mininum Date and vEndDate consists of Maximum Date.
pradip thanks for your help man but i have doubt if i assign start date and end date there might be even saturday and sunday in middle it might give an error
This perhaps:
For Each vDir in DirList('..\Data Source\*')
LOAD *,
FileBaseName() as Source
FROM $(vDir)\NT\*.xls
(biff, embedded labels, table is Sheet1);
Next
Assumes that all the files have the same fields. Adapt the dirlist path and the load statement for your requirements.
but i have the folder in daily date from 1-01-2016 to 28-02-2016 except weekends i have to retrive the file on the date
28-01-2016,
29-01-2016,
01-02-2016,
02-02-2016
Try to use below script.
for i = num(date#(vStartDate, 'DD-MM-YYYY')) to vEndDate
let vTemp = text(date($(i), 'DD-MMM-YYYY'));
if not (WeekDay(date($(i))) = 'Sat' or WeekDay(date($(i))) = 'Sun') then
LOAD
ID,
Type,
Data
FROM
[..\Data Source\$(vTemp)\NT\*.XLS]
(ooxml, embedded labels, table is Sheet1);
ENDIF
next