One Star

miminum length validation

Hi,
I want to validate postal code of having 6 digit length .How to validate minimum and maximum length of digit. I have used tSchemaComplianceCheck component but it validate only maximum length data.
Will you please suggest me how to validate minimum length of data?
Thanks in advance.
8 REPLIES
One Star

Re: miminum length validation

Hi abc1290,
Can you share sample input values? Both valid and invalid.
Thanks
Dwanny
One Star

Re: miminum length validation

Hi,
valid values-411019 , 411033 ,234564 etc (output file should contain only 6 digit values).
Invalid values- 123 , 2345 , 12345678 , 23455 etc.
Thank you.
Community Manager

Re: miminum length validation

Hi
You can use tFilterRow to filter the row with customized Java code, for example:
tFileInputDelimited--main--tFitlerow--filter--tLogRow_1
--reject--tLogRow_2
check the 'advanced mode' option, and define its expression as below:
input_row.columnName.length()==6
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: miminum length validation

Hi,
Its working fine :-)
Thank you.
One Star

Re: miminum length validation

Hi,
How to trim the unnecessary spaces in the 6 digit lenght from right,left side and also from middle of the lenght.
For eg '12 345'->this gives 6 digit lenght but for me its only 5 digit ,so will you please help me out in these.
Thank you.
Moderator

Re: miminum length validation

Hi,
There is "Trim" option in Advanced Setting of tfileinputDelimited component. Is it working for your case?
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: miminum length validation

Hi,
The trim option which you have suggest is for trimming column.I want to trim the space inbetween digits.
for eg input is "123 456" then output will have 123456.
Thank you.
One Star

Re: miminum length validation

Hi abc1290,
You can refer the below link to get a similiar job:
http://www.talendforge.org/forum/viewtopic.php?id=32537
Thanks,
Dwanny