Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Gadje
Contributor III
Contributor III

Data from tJava in tMap

Hi everybody,

i would like pass data from tJava into tMap, is ther anybody who knows how to do it ? Please

My tJava code look like that :

package routines;

import java.io.*;

import java.util.Arrays;

public class ClearCodeFab {

   //RETOURNE UN STRING CONCATENE

   public static String clear(String csvFile) throws IOException {

      String splitBy = ";";

      String line="";

      String result=null;

      BufferedReader br = new BufferedReader(new FileReader(csvFile));

      while ((line = br.readLine())!=null){

         String[] tabFab = line.split(splitBy);

         String codeFab=tabFab[4];

         if (tabFab[5]!=null) {

            String nomFab=tabFab[5].replaceAll(" [(][A-Z][A-Z][A-Z][0-9][0-9][)]|[(][A-Z][A-Z][A-Z][A-Z][0-9][0-9][)]|[(] [A-Z][A-Z][A-Z][0-9][0-9][)]|[(][(][A-Z][A-Z][A-Z][0-9][0-9][)]|[(][A-Z][A-Z][0-9][0-9][0-9][)]|[\\[][A-Z][A-Z][A-Z][0-9][0-9][)]|[(][A-Z][A-Z][A-Z][0-9][0-9][\\]]", "");

            //for(int i=0; i<tabFab.length; i++) {

               result += codeFab.substring(1, 6)+";"+nomFab+"\n";

            //}

         }

      }

      return result;

   }

}

 

I tried with Array of String in return but it didn't work too.

 

My job structure :

0693p000009q3SCAAY.jpg

 

My error message :

Exécution en erreur :Erreurs de compilation du Job

Au moins le Job "recupCodeFabricantBac" a des erreurs de compilation, réparez et réexportez.

Ligne en erreur: 794

Message détaillé: Type mismatch: cannot convert from String[] to String

Il peut y avoir d'autres erreurs causées par la compatibilité avec la JVM. Vérifiez que les paramètres de votre JVM sont les mêmes que dans le studio.

Job recupCodeFabricantBac terminé à 17:18 29/09/2020. [Code sortie=0]

My tMap structure :

0693p000009q3gHAAQ.jpg

 

Thanks in advance.

Labels (2)
10 Replies
Gadje
Contributor III
Contributor III
Author

Thanks Papaki,

i'll try and i'll tell you.