Searching a string and extract values

Highlighted
Four Stars

Searching a string and extract values

HI,

I have a use case where I have to search for a string "INC TYPE" and extract the values after the particular string.The string can be anywhere in the description. Please find example 

complete desc:

Simulation INC TYPE 566-A8970

ABN Cor INC TYPE 768-B5679

INC TYPE 897-B6789

Operations building INC TYPE 225-T5679 Legal 

 

My expected output:

566-A8970

768-B5679

897-B6789

225-T5679

 

Please suggest. Thanks for your help!


Accepted Solutions
Eight Stars

Re: Searching a string and extract values

Please mark the post as resolved so that others can use

All Replies
Moderator

Re: Searching a string and extract values

Have you tried using tExtractRegexFields?

Nine Stars

Re: Searching a string and extract values

Are you looking for below output?

IncType.PNGIncType1.PNG

Regards,

Veeru Boppudi
Four Stars

Re: Searching a string and extract values

Thanks Veera!
Yes that was my expected output.
Four Stars

Re: Searching a string and extract values

Hi, I shall try and update you. Thanks for your response!
Ten Stars

Re: Searching a string and extract values

Should you wish to use tExtractRegexFields, this pattern should yield the result you're looking for:

"INC TYPE (\\d{3}-[A-Z0-9]{5})"
Four Stars

Re: Searching a string and extract values

Thank you all. It is resolved now.
Eight Stars

Re: Searching a string and extract values

Please mark the post as resolved so that others can use

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

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch