8 Replies Latest reply: Sep 28, 2016 3:29 PM by dick elsman RSS

    Check for file in script

    dick elsman

      Hi guys,

       

      Currently I'm loading my file with an wildcard and variables, looking like this:

       

      SET var_datasourcefile='BC*.xml';

      trace $(var_datasourcespath1)$(var_datasourcefile);

       

      LOAD *

      FROM $(var_datasourcespath1)$(var_datasourcefile);

       

      that is working out great, but now I want to check if the xml file exists in the map, and if it doesnt exist, it should skip the script.

      I thought it could be done like this:

       

      SET var_datasourcefile='BC*.xml';

      IF filetime($(var_datasourcespath1)$(var_datasourcefile))>0 then

       

      LOAD *

      FROM $(var_datasourcespath1)$(var_datasourcefile);


      ENDIF


      However, this doesn't seem to work, can anyone help me with this?


      Thanks a lot!


      Best regards,


      Dick