This article explains how to execute a command that contains spaces using a tSystem component and also offers troubleshooting suggestions for potential problems you may encounter.
This procedure was written with:
This example shows how to execute a system command using a tSystem component to copy a file named "a b c.txt" (for example) from C:\ to D:\ in different Talend Studio releases.
Enter the following Java code in the Command field:
Since Talend Studio 5.1, a new feature Use Array Command is provided. This feature allows you to set an array of commands. Below is an example introduces this feature:
You will encounter the below error when executing a command with spaces as follows:
The system cannot find the specified file
This is because tSystem component truncates the command at the first space in the file name. To fix this problem, use the suggested workaround or upgrade to version 5.1 or higher.