Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
livio218526
Creator
Creator

Upload all filename in a path

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

1 Solution

Accepted Solutions
OmarBenSalem

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

View solution in original post

1 Reply
OmarBenSalem

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