extracting a string after a character

Four Stars

extracting a string after a character

I have the following:

LI04_1503

AS03_18456

AS03_P45

...

I'm using  StringHandling.LEFT(row1.SOURCE_SITE_ID,4)  this extracts the first 4 elements, but what I need is to select everything after the '_' so the result would be:

1503

18456

P45

I'm a beginner, can anyone help me with this string manipulation?

Thanks,

Gary

 

Moderator

Re: extracting a string after a character

Hello,

Could you please try this method StringHandling.LEFT(row1.SOURCE_SITE_ID,5) to see if it works?

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.
Four Stars

Re: extracting a string after a character

StringHandling.LEFT(row1.SOURCE_SITE_ID,5) removes the first 5 characters from the left, however, in my example the number of characters to be removed varies, I need to remove either everything before and including the _ to the left or right. I'm trying to get into Regex syntax to see if that has what I need.

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch