Extract first 10 digits from a string

More
10 years 7 months ago #6418 by hanisultan
Since ODBC for access doesn't support user defined function I would have to perform this task within ETL PRO. Can someone please tell me how to extract the first 10 digits from a string? The string was should be only phone number but its mixed with letters and characters. Please help

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #6459 by admin
You can use "Left" transformation function for that or substruct

Mike

Mike
ETL Architect

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #6462 by hanisultan
That wouldn't work. Here is an example

lets assume I have the following string : (7`14) 452-7456 none 567

how do I transform it so it becomes 7144527395

I would need to first get only the numbers in that string then use left to get only the first 10

Can we do that here ?

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #6463 by admin
You can use function called "keep characters" to get rid of all non numeric characters.
Full list of functions is in the documentation.

Mike

Mike
ETL Architect
The following user(s) said Thank You: hanisultan

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #6470 by hanisultan
Thank you , I actually had to use that and the left function. I did read the document. I want to use length to give me the length of the string to check how long it is but that function will give a number and that is it. I couldn't find a function that will test the length of a string and allow me to do something

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #6476 by admin
I couldn't find a function that will test the length of a string and allow me to do something

You can use "calculation" for that

Mike

Mike
ETL Architect

Please Log in or Create an account to join the conversation.