3

I have a folder with a few .PDF files saved in there. How do I set up a Foreach Loop Container to capture just the title names of these files and then pass this as a parameter?

PDF files:

123.pdf
223.pdf
333.pdf 

After Foreach Loop container completes its execution, the values should display as shown below:

Output:

123
223
333

1 Answer 1

2

Take a look this article, it's using 2005 but it's the same steps and interface in 2008 too. http://www.sqlis.com/sqlis/post/Looping-over-files-with-the-Foreach-Loop.aspx

Select "name only" radio button in the for each loop editor collection's page. It returns only the name of the file and not extension. That's the only change you'll have to make.

Filename is stored to a variable. This is defined in the variable mappings page. Now, if you want to store these values to a table, add an execute SQL task and write an insert statement. Insert statement will look like Insert table (col) values (@varname). Lastly, parameterize this execute SQL task.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.