Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a loop where I generate a filename based on a date-value. The filename is representing a csv-file which should be loaded with a load statement, for example LOAD log20100212.csv . But not all generate filenames do physically exist, so that the LOAD script run into an error.
Is there any possibility to check if a file physically exist before I try to use it for loading. In the most programming languages exist some functions like 'isfile()', checking if a file exist, but I found nothing equal in the script functions.
Has anyone an idea?
thanks Thomas
I've used the filesize function to determine the size of the file and then use the WHEN condition to load the file if the size > 0.
WHEN filesize('somefile.xlsx') > 0
SpreadsheetsA:
load *
from somefile.xlsx (ooxml, table is Sheet1 );
I've used the filesize function to determine the size of the file and then use the WHEN condition to load the file if the size > 0.
WHEN filesize('somefile.xlsx') > 0
SpreadsheetsA:
load *
from somefile.xlsx (ooxml, table is Sheet1 );
Thanks - this helps!
Can you loop this syntax for every 10 minutes, till it finds the file and then execute the load statement?