Tuesday, April 24, 2012

Use tSystem in Talend with Windows Command Prompt

I was working with a colleague of mine to list the directories/files in a directory using Talend. We could have used tFileList but on 4.1.2 it is really slow especially when you want additional info such as file properties.

We struggled with this venture for a while but finally nailed it down.To get a list of file names in Windows you need to run the dir /b command on the cmd prompt. After a few reties and help from google -
http://stackoverflow.com/questions/515309/what-does-cmd-c-mean, we figured it out.

In the tSystem component make sure you have the home directory set to what-ever the top level directory is where your files exist and in the command box - type in
 cmd /c dir /b

This forces the command line to execute the command dir and close after it does so. If you use the /K command your Talend server/console will hang.

Hope this helps.  


No comments:

Post a Comment