简体   繁体   中英

How can I create an SSIS package which loops through excel files with a specific keyword in their name?

I am creating an SSIS package which needs to selectively loop through excel files in a folder that contain a specific keyword in their name (the keyword can appear anywhere in the name). This folder will include multiple files that do not include this keyword.

Bonus: I then need to use that same file name to create a date variable in SSIS (the file name will have the required components to create the date inside it). So far my efforts have failed, any help would be appreciated!

Create a Foreach File Loop Enumertor. In the FileSpec, use a wildcard, such as:

*SearchString*.csv or *SearchString*.xslx

You will probably want to select the Filename and Extension radio button. Map that to an SSIS package variable.

For the bonus, you can create another package variable with an expression based on the mapped variable and perform whatever string parsing you need in order to extract information from the file name.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM