I was trying to execute a batch file using SSIS execute process task. This task accepts only one argument. The argument is @[User::TabProjectName]=www.servername Dev_Admin Password123 DENMARK DEV V_Weekly_DEV.This is a space-separated string. How to split this single string into multiple substrings based on space and assigned to variables as shown below using Batch command?
set servername=www.servername
set username=Dev_Admin
set tabpwd=Password123
set sitename=DENMARK
set projectname=DEV
set datasourcename=V_Weekly_DEV
This was originally posted with a powershell tag, so this is how it can be done with powershell:
$splitString, splits the initial string on spaces as no character is passed to the split operator. Each item in the split array can be referenced by its place number. The $serverName needs an additional split to get the data to the right of the '=' sign.