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
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"))
-----------

All Replies
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"))
-----------
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 GARNER 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

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

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

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog