HashMap data to tFileOutputExcell

One Star

HashMap data to tFileOutputExcell

Hi
I am new with Talend.
I have create an HashMap that I am put in the Globalmap. I created via tJavaFlex
Now I would like to know how I have to do to use my Hashmap to export it inside an outputfile. (example : tFileOutputExcell)?
How can I use an object from the globalMap as an entry of a Talend component?
thks a lot
Valery
One Star

Re: HashMap data to tFileOutputExcell

Hi Valery
You can set expression of one column in tMap and link tMap with tFileOutputExcell.
globalMap.get(key);                // the expression

Or you can link tJavaRow with tFileOutputExcell.
Regards,
Pedro
One Star

Re: HashMap data to tFileOutputExcell

hello Pedro,
As mentionned I am new with Talend. How can I in detailed use globalMap.get("data")<String,Float> as an expression in TJavarow and assign keys to one column and values to another colums?
thks for your help
Valery
One Star

Re: HashMap data to tFileOutputExcell

hello Pedro,
As mentionned I am new with Talend. How can I in detailed use globalMap.get("data")<String,Float> as an expression in TJavarow and assign keys to one column and values to another colums?
thks for your help
Valery
One Star

Re: HashMap data to tFileOutputExcell

Hi Valery
For example, you have a column called "Name" which you want to pass to tFileOutputExcel.
Now link tJavaRow with tFileOutputExcel and set Java code as follows.
output_row.name = (String)globalMap.get(key);   //

Regards,
Pedro
One Star

Re: HashMap data to tFileOutputExcell

Also linked to this question. How can I assign a list to a row
row2.col1 = data.keySet();
or
row2.col1 = myArrayList;
Thks a lot
Valery
One Star

Re: HashMap data to tFileOutputExcell

Hi Valery
This is decided by the data type of columns.
Why do you assign a list to a row?
Regards,
Pedro
One Star

Re: HashMap data to tFileOutputExcell

hello
The idea... I have a TJavaFlex. In the code, I am creating java object : an HashMap<String,Float>
Now what are the next componement I have to use in order to create a tFileOutputExcel Having 2 columns :
String1 Float1
String2 Float2
String3 Float3
thks
Valery
One Star

Re: HashMap data to tFileOutputExcell

Hi Valery
I don't know why you use HashMap in tJavaFlex. There must be more convenient way to pass values.
To get values from HashMap. you can use tMap and set expression HashMapName.get().
Regards,
Pedro
One Star

Re: HashMap data to tFileOutputExcell

Pedro,
What do you advice me? components? according to explanation that I gave you about what I have to do
thks
Valery