Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
WSyahirah21
Creator

Redirect data to a file using echo in tSystem component

I need to run an echo command to redirect data into a file using echo in text. I know I can use bash or python script to do so. however, that is impossible so far as the destination file is defined from context section in Talend.

My command is :

"

"echo 'Full Refresh Ingestion' " + ">>" + context.textfile

However, the output only print out back the command I created -> Full Refresh Ingestion >> /path/ingest.txt

Is there any way I could do to save the statement I declare into a file that is already defined in Contexts, using tSystem component?

Please assist, thanks

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable

I tried the command on Linux and it does not work on Linux.

"echo HELLO >> "+context.filepath

Try another way to log the output to a file, select ' standard output' on tSystem to global variable, and then output the value of global variable to file.

0695b00000OAvxGAAT.png0695b00000OAvxLAAT.png

View solution in original post

6 Replies
Anonymous
Not applicable

Hi

I try this command using tSystem on Windows and it works.

"cmd /c echo HELLO >> "+context.filepath

 

Regards

Shong

WSyahirah21
Creator
Author

Hi Shong, tried before and i received this error message -> tSystem_1 Cannot run program "cmd": error=2, No such file or directory

DId I missed any config?

 

 

Anonymous
Not applicable

What is your OS? Linux?

WSyahirah21
Creator
Author

yes linux

 

Anonymous
Not applicable

I tried the command on Linux and it does not work on Linux.

"echo HELLO >> "+context.filepath

Try another way to log the output to a file, select ' standard output' on tSystem to global variable, and then output the value of global variable to file.

0695b00000OAvxGAAT.png0695b00000OAvxLAAT.png

WSyahirah21
Creator
Author

thanks!