Extract Value

Hi Team,

I want to extract value from a sentence .
Mapping of value are like below
image

Please find the 6 sample inputs:
Role/Rate/Assign:
Sr. Manager / $290 / Kamal Dey

Role/Rate/Assign:
Sr. Manager / $290 / Kamal Dey, Mahesh Kumar

Role/Rate/Assign:
Sr. Manager / $290 / Kamal Dey, Mahesh Kumar Role/Rate/Assign:
Implementation Manager / $290 / Rohan Roy

Role/Rate/Assign:
Sr. Manager / $290 / Kamal Dey, Mahesh Kumar Role/Rate/Assign:
Implementation Manager / $290 / Rohan Roy, Karan Kumar

Role/Rate/Assign:
Sr. Manager / $290 / Kamal Dey, Mahesh Kumar Role/Rate/Assign:
Implementation Manager / $290 / Rohan Roy, Karan Kumar Role/Rate/Assign:
Director / $290 / Raman Raghav

Role/Rate/Assign:
Sr. Manager / $290 / Kamal Dey, Mahesh Kumar Role/Rate/Assign:
Implementation Manager / $290 / Rohan Roy, Karan Kumar Role/Rate/Assign:
Director / $290 / Raman Raghav, Sohan Kumar

I need output/Values like :

Sr. Manager , Kamal Dey
Sr. Manager , Kamal Dey, Mahesh Kumar
Sr. Manager , Kamal Dey, Mahesh Kumar Implementation Manager , Rohan Roy
etc…

Ahesham

You can do these steps @md.ahtesham

  1. Split the entire string with colon first and store them in two different strings
  2. Then split each substring you got with slash (/) and store them in arrays
  3. Then you can map them using the indexes

Hope I’m clear

1 Like

Thanks @HareeshMR,
This is one way… I was wondering if I can extract info which satisfy all the 6 sample.

Currently If I follow your way it will not work work for another set of sample, and have to deal with lots of condition.

Anyway thanks i.will try .

Ahtesham

I found those 6 are in the same format so that you can do above steps @md.ahtesham

Can you post any two different strings for my understanding

Format is same @HareeshMR , just the thing is there could 1 name under under Sr. Managar or 2 name under Sr. Manager

Or there could two kinds of role one Could be Sr. Manager and other could be Implementation Manager and can have one or two or three names under that… if have described the mapping in the pic above.

Input : Role/Rate/Assign:Sr. Manager / $290 / Kamal Dey
Output: Sr. Manager - Kamal Dey

Input : Role/Rate/Assign:Sr. Manager / $290 / Kamal Dey, Mahesh Kumar
Output: Sr. Manager - Kamal Dey , Manish Kumar

Input : Role/Rate/Assign:Sr. Manager / $290 / Kamal Dey, Mahesh Kumar Role/Rate/Assign:Implementation Manager / $290 / Rohan Roy
Output : Sr. Manager - Kamal Dey , Manish Kumar
Implementation Manager - Rohan Roy

Likewise others, hope this elaborates the question.

Ahtesham

Yeah, that’s fine right? as we are splitting with slash and colon, it will return both the values (as we are not splitting with comma(,) here ) @md.ahtesham

I hope you got it

@HareeshMR,
I don’t know regex much, can someone help me with regex expression so that below text
Role/Rate/Assign:
Sr. Manager / $290 / Kamal Dey, Mahesh Kumar Role/Rate/Assign:
Implementation Manager / $290 / Rohan Roy, Karan Kumar Role/Rate/Assign:
Director / $290 / Raman Raghav, Sohan Kumar

Could be splitted as below in three different lines.
Role/Rate/Assign:Sr. Manager / $290 / Kamal Dey, Mahesh Kumar
Role/Rate/Assign:Implementation Manager / $290 / Rohan Roy, Karan Kumar
Role/Rate/Assign:Director / $290 / Raman Raghav, Sohan Kumar

Ahtesham

@md.ahtesham

I don’t know regex much. Just learning now. you can use the above solution even splitting first with new line , then with colon and then slash. But if you want to use regex, that is also a better option compared to the above process