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)
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,
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.