Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I am using File size function to remove file where no data available and it only contain error message. I have one folder which consist of many file with similar name and date of a file(as mentioned below).
SalesData20160401
SalesData20160402
SalesData20160403 and so on,
There are few files which does not contain niether data nor header. I am trying to load all the files from a particular folder (as stated below) and want to exclude file for which the size is below 10 KB.
D:\Data\SalesData\(files are stored under this path)
How can I exclude those file which are having a size of less than 10 KB?
Thanks,
Imran K
maybe
for Each file in FileList('.\SalesData????????.txt')
// change the load, this is for my test files
tmp:
First 1 LOAD
@1,
FileSize() as fs
FROM
$(file)
(txt, codepage is 1252, no labels, delimiter is '\t', msq);
let filesize = Peek('fs');
DROP Table tmp;
if('$(filesize)' > 10*1024) then
trace ***** load file $(file) filesize=$(filesize);
else
trace ***** dont load file $(file) filesize=$(filesize);
endif
next