Cat file in a variable

Highlighted
Four Stars

Cat file in a variable

Hi,

I have a Tssh component which fires a cat command to a file

eg: cat file1.txt

 

Now I need to save the file1.txt components in a string variable. How can i achieve this?

 

Thanks

Ajinkya


Accepted Solutions
Highlighted
Forteen Stars

Re: Cat file in a variable

Hi,

 

yes, you can

select checkbox for save output to variable

Screen Shot 2019-04-20 at 1.47.42 AM.png

 

and use

((String)globalMap.get("tSSH_1_STDOUT"))
-----------

View solution in original post


All Replies
Highlighted
Forteen Stars

Re: Cat file in a variable

Hi,

 

yes, you can

select checkbox for save output to variable

Screen Shot 2019-04-20 at 1.47.42 AM.png

 

and use

((String)globalMap.get("tSSH_1_STDOUT"))
-----------

View solution in original post

Highlighted
Four Stars

Re: Cat file in a variable

Okay, it is working now.

Thanks.

Earlier I had not selected to store the output on global variable.

After doing that, I am able to store the output to a String.

Thanks!!!

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog