PDI Configurations

Here is the code which enables you to manually select the kettle.properties and shared.xml file basically this is advice when you are working on different projects at a time. 
 
Replace add the below code in a new .bat file.


@echo off
set pathtospoon=C:\pdi-ce-5.0.1.A-stable\data-integration\spoon.bat
set rootconfigpath=C:\pdi-ce-5.0.1.A-stable\ProjectConnections\
 
echo ETL Profiles:
 
::build "array" of folders
 
setlocal enableDelayedExpansion
 
set folderCnt=0
for /f "eol=: delims=" %%F in ('dir /b /ad %rootconfigpath%') do (
  set /a folderCnt+=1
  set "folder!folderCnt!=%%F"
)
::print menu
for /l %%N in (1 1 %folderCnt%) do echo %%N - !folder%%N!
 
::get selection
set selection=
set /p "selection=Enter ETL profile to use: "
 
::set the KETTLE_HOME variable and start spoon
echo.
echo Kettle home set to %selection% - !folder%selection%!
echo.
SET KETTLE_HOME=%rootconfigpath%\!folder%selection%!
%pathtospoon%

No comments:

Post a Comment