One Star

tFileInputExcel

Hi,
I am parsing a sales log, all columns seem to parse find to strings (just testing at the moment), but when I get to the column with a £ sign in it, it throws a parse exception:
Exception in component tFileInputExcel_7
java.text.ParseException: Unparseable number: "£888.40"
at java.text.NumberFormat.parse(Unknown Source)
at asd.generatecobrajobs_0_1.GenerateCobraJobs.tFileInputExcel_7Process(GenerateCobraJobs.java:1169)
at asd.generatecobrajobs_0_1.GenerateCobraJobs.runJobInTOS(GenerateCobraJobs.java:2159)
at asd.generatecobrajobs_0_1.GenerateCobraJobs.main(GenerateCobraJobs.java:1908)
I see others have had various signs fixed such as $ etc. I am using 5.1.2 and the bug still produces on various machines.
Any help would be greatly appreciated.
6 REPLIES
Moderator

Re: tFileInputExcel

Hi,
We have seen your error info. Something wrong with your data format "£888.40". Would you mind uploading the screenshot about your schema in component -tFileInputExcel_7,or you can check the code in studio to find the cause and we will track your issue.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: tFileInputExcel

Hi Sabrina,
thanks for coming back to me, it is really appreciated. Please find attached pictures reflecting the configuration. I will attempt to find the code in question.
One Star

Re: tFileInputExcel

temp_row_tFileInputExcel_7 = df_tFileInputExcel_7
.format(numberFormat_tFileInputExcel_7
.parse(dataFormat_tFileInputExcel_7
.formatCellValue(
cell_tFileInputExcel_7,
workbook_tFileInputExcel_7
.getCreationHelper()
.createFormulaEvaluator())));

is the code in question throwing the error
Moderator

Re: tFileInputExcel

Hi,
We have seen your related pics and code. All of your type are set as "String" which cause the issue.
format(numberFormat_tFileInputExcel_7
.parse(dataFormat_tFileInputExcel_7
.formatCellValue(

. As the code said, the data format is wrong.
Try to set your datatype of "£888.40" as float or others currency type.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: tFileInputExcel

Thanks, I will do this. Though I was hoping to do this without having to format anything at all. Is there any way that the component can read this format?
Maybe if I output the source and adjust it?
Highlighted
Moderator

Re: tFileInputExcel

Hi,
Maybe if I output the source and adjust it?

We don't do it before and what we can do is change the format into the right. You can take a try and would you mind giving the feedback result. All of us will be interested in it.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.