tFileInputDelimited - Exception Error with white spaces

Highlighted
One Star

tFileInputDelimited - Exception Error with white spaces

Hi - I've run across a problem with the tFileInputDelimited component. I have a delimited file using the "|" character as the column delimiter. Some of the columns have some embedded white spaces though ( I think they are tab characters). When I attempt to import the file, I'm getting an exception error. Some come in fine, but the records that appear to have the additional white spaces cause the exception error. I tried using a tMap with a trim() expression to trim off the white space, but the error occurs in the tFileInputDelimited component before reaching the tMap. If I use a text editor to remove the white spaces (or tab characters) it works fine.
is there a way to ignore the white spaces or tab characters and avoid the exception error? Just hoping to avoid any pre-processing of the file before the import.
I'm using Talend 2.2.0 on windows. Error message is:
Exception in component tFileInputDelimited_2
java.lang.NumberFormatException: For input string: " Model Name"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at routines.system.ParserUtils.parseTo_Integer(ParserUtils.java:73)
at newweb.ldsimport.LDSImport.tFileInputDelimited_2Process(LDSImport.java:186)
at newweb.ldsimport.LDSImport.runJob(LDSImport.java:510)
at newweb.ldsimport.LDSImport.main(LDSImport.java:448)
Highlighted
Employee

Re: tFileInputDelimited - Exception Error with white spaces

Hello,
" Model Name" is not a valid Number for your column.
It really looks like the first line of your file. If so, you may add a header of 1 to your tFileInputDelimited.
Else you need to read it as a String and use a tSchemaComplianceCheck.
Regards,
Highlighted
One Star

Re: tFileInputDelimited - Exception Error with white spaces

Thanks for the reply, but "Model Name" is the String, not the header name. And it works fine on other rows in the file unless there are embedded tabs in the data.
Highlighted
One Star

Re: tFileInputDelimited - Exception Error with white spaces

Hi headjoog, 
Did you get any solution, even i'm facing same issue. Can you please help me out.

2019 GARTNER 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

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

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