Fatest way to check that a string corresponds to criterias?

Six Stars

Fatest way to check that a string corresponds to criterias?

Hi,

 

If I got a random string and I want to make some checks to see if it's valid or not. For example string must start with '1', length must be 20, fifth character must be different from '0' and such things like that...

 

What is the fatest way to achieve such verifications? I can use regex patterns if needed.

 

I thought about using a tJava with plain java text but maybe there is better ways.

 

Thank you for your help.

Employee

Re: Fatest way to check that a string corresponds to criterias?

Hi,

 

     The easiest way will be to use the various functions in the tmap. You can also use java functions and regex functions also apart from standard functions provided in below list.

 

image.png

 

 

Warm Regards,

 

Nikhil Thampi

Ten Stars

Re: Fatest way to check that a string corresponds to criterias?

The fastest way is to rank your checks on % of occurrences on, highest -> lowest ... and code logic according to these metrics.

Example if 99.9% of your strings have a length of >= 20 and
75 % of your strings starts with a one... You will start a comparison whether its a one, next length...
Use regex for complex comparison and simple string functions for other comparisons.

Increasing code logic will result in poor(er) performance, keep it clean.
However, I wouldn't care to much about overhead on string comparison and checks.
If you are able to do it on (raw) bytes or a numerical representation you will improve overall performance.

15TH OCTOBER, COUNTY HALL, LONDON

Join us at the Community Lounge.

Register Now

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

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog