• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Ne peux pas convertir de string à boolean

#1 2010-04-26 16:48:48

PassionjE
Guest

Ne peux pas convertir de string à boolean

Tags: [remove, space, string]

Bonjour, je voudrais supprimé les espaces dans des numeros de téléphones et les remplacés par rien du tout, cependant lorsque je compile, j'ai cette erreur:
"Impossible de convertir de String à Boolean", je ne comprends pas comment faire car les numéro de téléphone sont bien des string .... aurait - il une autre fonciton utilisable ?
voici mon code:

StringHandling.CHANGE(row1.Telephone_contact,"","")

#2 2010-04-27 05:58:02

FredoJFO
Member
Registered: 2010-04-20
Posts: 31

Re: Ne peux pas convertir de string à boolean

Bonjour,

Déjà dans un premier temps, dans la fonction StringHandling.CHANGE(row1.Telephone_contact,"",""), je ne vois pas où tu remplaces les blancs par du vide ? Ce ne serait pas plutôt StringHandling.CHANGE(row1.Telephone_contact," ","") pour être plus correct ?

En outre il existe aussi la méthode StringHandling.TRIM() qui semble enlever automatiquement les espaces. Après je ne sais pas si elle n'enlève que ce en début ou fin de chaîne, mais à essayer.

Concernant le booléen ça doit être le format attendu en sortie qui est mal configuré. Actuellement il doit attendre un booléen.


Regards

FredoJFO

Offline

#3 2010-04-27 06:03:39

shong
Talend team
Registered: 2007-08-29
Posts: 10357
Website

Re: Ne peux pas convertir de string à boolean

Hello guy
Please post your question in English.wink

Best regards
Shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

#4 2010-04-27 09:17:26

PassionjE
Guest

Re: Ne peux pas convertir de string à boolean

I would like to delete all the spaces in a phone number field xx xx xx xx xx => xxxxxxxxxx
I 'm trying to use the stringhandling.Change() function, as the FTRIM or TRIM function, but all return the same error after compilating:

"Cannot convert from string to boolean"
"This function isnt working with arguments such as (string, string,string)...

I already forced the output variable as boolean, but it does not change anything ...

Thx for helping, have good day!

#5 2010-04-27 12:05:56

shong
Talend team
Registered: 2007-08-29
Posts: 10357
Website

Re: Ne peux pas convertir de string à boolean

Hello
try

Code:

row1.phone.replaceAll(" ","")

Best regards
Shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

#6 2010-04-27 12:20:38

PassionjE
Guest

Re: Ne peux pas convertir de string à boolean

Thx, i tried but unfortunatly, it return me the same error....

#7 2010-04-27 12:22:55

shong
Talend team
Registered: 2007-08-29
Posts: 10357
Website

Re: Ne peux pas convertir de string à boolean

Hello
Which error do you get now? This function return string type, you shoud define its type as string, not boolean.

Best regards
Shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

#8 2010-04-27 13:03:56

PassionjE
Guest

Re: Ne peux pas convertir de string à boolean

Hello

The format is the good one, String .... But there is still the same error message ....

#9 2010-04-27 13:32:42

PassionjE
Guest

Re: Ne peux pas convertir de string à boolean

Hello

Btw i simply used the tReplace component, and its works very well big_smile

Still thx for helping smile
NOw i am wondering how to Load the output file in another excel file, or update the input one, any idea ?

#10 2010-04-27 14:57:53

shong
Talend team
Registered: 2007-08-29
Posts: 10357
Website

Re: Ne peux pas convertir de string à boolean

Hello

The format is the good one, String .... But there is still the same error message ....

What's the error message? Can you upload some screenshots of your job? I think it is a easy fixed problem.

NOw i am wondering how to Load the output file in another excel file, or update the input one, any idea ?

Do you want to output the same result to different files at one time? If so, you can use tReplicate to replicate a row many times as need.


Best regards
Shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

#11 2010-04-27 15:03:05

PassionjE
Guest

Re: Ne peux pas convertir de string à boolean

Hello

To be honnest i deleted this job when i found the tReplace component and did a new one wich works pretty good.
For the excel problem, i want to update the inputfile with the output one,i mean, i modified the phone number, so i want remove the old one and put those on the input excel.. Hope i am clear ~

Regards

Steph

#12 2010-04-27 15:48:38

shong
Talend team
Registered: 2007-08-29
Posts: 10357
Website

Re: Ne peux pas convertir de string à boolean

Hello
It is impossible to update the input file, need to output the result to a new file using tFileOutputExcel component.

Best regards
Shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

#13 2010-04-27 16:01:09

PassionjE
Guest

Re: Ne peux pas convertir de string à boolean

Hello

Good to know it, thanks a lot smile Ok now i am still looking for a solution to test the matching between phone number and postal code, sounds like i have to create my own routine ... But i dont know anything about java ...

#14 2010-04-27 16:29:07

shong
Talend team
Registered: 2007-08-29
Posts: 10357
Website

Re: Ne peux pas convertir de string à boolean

Hello
About the matching between phone number and postal code, it is possible to write some rules or relationships between number and postal code on a file?

Best regards
Shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

#15 2010-04-27 17:02:50

PassionjE
Guest

Re: Ne peux pas convertir de string à boolean

Hello

Here is on X the first 2 number of postal code, on Y the 4 first number of phone number, this table show the matching pattern with yellow point.

http://www.el-annuaire.com/numero-tel-en-01.php

Thx
regards.
PassionjE

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Ne peux pas convertir de string à boolean

Board footer

Powered by FluxBB