1 Reply Latest reply: Jan 26, 2018 4:36 AM by omar bensalem RSS

    Upload all filename in a path

    Livio Sebastiano Colombo

      Hi Everyone,

      I need to load all file name in a Path that I have set like a variable.

       

      I try to use this code, but it doesn't fix:

       

      SET vPath = 'lib://FilePath/';

      Directory;

      LOAD

           *,

           filebasename( ) as x

      FROM

      [$(vPath)]

      (biff, embedded labels, table is Sheet1$);

       

      Where Lib is the connection name.

       

      Thanks

        • Re: Upload all filename in a path
          omar bensalem

          in this folder, you have many excel files for example, and you want to import the full name of each file?

           

          Try as follow: (adapt it tu ur script)

           

          Data :

          load 0 as field AutoGenerate(0);

           

          For Each vPath in FileList('lib://Test/*.xlsx')

          Concatenate

          Load

          '$(vPath)' as name

          FROM [$(vPath)]

          (ooxml, embedded labels, table is Sheet1);

           

           

          Next vPath

           

           

          Drop Field field From Data;


          Result:

          Capture.PNG