Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
posywang
Creator
Creator

How to load from source file with similar file name

Hi I remember I learnt this in training but could not find it in the training book. If I have two source file 2018MasterList.xlsx and 2019MasterList.xlsx. How to write script to load them both use maybe *MasterList.xlsx or something similar that I can't exactly remember. Thanks.

5 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Just like you thought. Change the filename to use * for a wildcard

*MasterList.xlsx

-Rob

posywang
Creator
Creator
Author

I got Bad Zip file error but the error is gone if I use 2018MasterList.xlsx or 2019MasterList.xlsx so both files are not corrupted.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Can you post your script log?

-Rob

posywang
Creator
Creator
Author

LOAD
[Health Status],
[Month Reporting On] as [Month Full Name],
Modified,
[Modified By]

FROM
[http://XXXXX/*MasterList.xlsx]
(
ooxml, embedded labels, table is Sheet1)
Where [Month Reporting On]<>'February';

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You are trying to load these with http:, not directly from file?  I don't think wildcard will work with http:. Instead you will have to list the contents of the directory and write a loop to process each file.  I believe there are working examples here on the forum, but I can't locate one at the moment. 

Perhaps someone else can point to an example?

-Rob