Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
i want to load multiple files from a folder
so how i can achieve this and also handle if there are duplicate files
like i have files with name
sales_20140203
sales_20140305
sales_20140305
Thanks
Kushal Thakral
You can use a wildcard in your file name, like
LOAD Field1, Field2 FROM sales_*.xls
(biff, embedded labels, table is Sheet1$);
Or use a loop, like shown in the HELP
FOR Each File in filelist (Root&' \*.' &Ext)
LOAD
'$(File)' as Name,
FileSize( '$(File)' ) as Size,
FileTime( '$(File)' ) as FileTime
autogenerate 1;
NEXT File
I don't think you can have duplicate file names in the same directory.
Hi All
Any one has solution for this.
Thanks
Kushal Thakral
You can use a wildcard in your file name, like
LOAD Field1, Field2 FROM sales_*.xls
(biff, embedded labels, table is Sheet1$);
Or use a loop, like shown in the HELP
FOR Each File in filelist (Root&' \*.' &Ext)
LOAD
'$(File)' as Name,
FileSize( '$(File)' ) as Size,
FileTime( '$(File)' ) as FileTime
autogenerate 1;
NEXT File
I don't think you can have duplicate file names in the same directory.
Hi,
Try below script. Include * instead of your file date Ex: sales_*
Load FieldName1,
FieldName2,
..........
From
sales_*;
Thanks Swuehl
It helped me alot
Regards
Kushal Thakral