Regex expresion replace a field if pattern exists

One Star

Regex expresion replace a field if pattern exists

I am trying to find a solution using a tReplace where a string is contained in the original field and I want to replace the whole field with a new string. For example I would like to replace any string containing the word or pattern bolt with the word bolt.

original field
______________
hexbolt
3/4" bolt, stainless steel
boltpart

I know it is easy to change a single word with another word but I am looking for a solution to change the entire phrase. Has anyone been able to do this before and if so can you provide an example?

Thanks!
Community Manager

Re: Regex expresion replace a field if pattern exists

Hello friend
Sorry for a little delay!
To fit your request, you should use the advanced model on'Advanced settings' tab. I show you an example,
input file:

hexbolt
3/4" bolt, stainless steel
boltpart

I will replace 'bolt' with 'AAA' in the entire phrase.
result:
Starting job forum5924 at 10:04 24/03/2009.
hexAAA
3/4" AAA, stainless steel
AAApart
Job forum5924 ended at 10:04 24/03/2009. [exit code=0]

Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Regex expresion replace a field if pattern exists

The question is actually how do you replace "hexbolt" with just "bolt"

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

Have you checked out Talend’s 2019 Summer release yet?

Find out about Talend's 2019 Summer release

Blog

Talend Summer 2019 – What’s New?

Talend continues to revolutionize how businesses leverage speed and manage scale

Watch Now

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