Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing a directory and file name variable that contains spaces from Foreach Loop to an Execute Process task

Tags:

ssis

I have a Foreach File Enumerator that loops through all files in a folder, saving the directory and file name to a variable @NextFile.

Inside the Foreach, I have an Execute Process Task which is passed the variable @NextFile.

I pass the variable by selecting Edit on the Execute Task, Expressions->Arguments->@[User::NextFile].

This works fine if the file name has no spaces, but when there is a space, the String passed in will end where the first space appears.

Eg: if the directory name is c:\files\file a.pdf, the variable will be c:\files\file

I've tried to enclose NextFile in quotes "@[User::NextFile]" but then the variable is set to "@[User::NextFile]"

like image 764
Dawson Avatar asked Oct 28 '25 05:10

Dawson


1 Answers

Make your expression look like:
"\"" + @[User::Filename] + "\""

Expression

like image 84
sorrell Avatar answered Oct 31 '25 11:10

sorrell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!