Want to extract value from string

Hi, Below is the string and i want to extract some value from string.

PROJECT NUMBER: N. 739387
c.i3 EXCHANGE: 2246
c.i4 - PHOENIX WIRE CENTER: TLSNAZMA
PERMIT AGENT WBS PERMIT MUNICIPALITY #1 WBS
ENGINEER: Shaeljn Lauderdale PERMIT MUNICIP. #2 WBS PERMIT MUNICIP. #3 was
TELEPHONE NUMBER: 602-696-71 1 1
TYPE OF WORK: Bore 583 and place 3 new HH’s alanq W raosevelt st and N 'IDIST AVE.
NAME OF PROJECT: N.739387 - CDFS - 1 GBPS - 10205 W ROOSEVELT ST
LOCATION: 10205 W ROOSEVELT ST

From above string i need to extract
Project Number
PHOENIX WIRE CENTER:
EXCHANGE: 2246:
ENGINEER:
TYPE OF WORK:
NAME OF PROJECT:
LOCATION:

Please help me out

@Puneet_Singh3 You can perform this using regex :
Replace Only the Keyword with the Keyword that you want to Extract. It should work.

@supermanPunch
ENGINEER: Shaeljn Lauderdale PERMIT MUNICIP. #2 WBS PERMIT MUNICIP. #3 was

I need Engineer Value as Shaeljn Lauderdale PERMIT MUNICIP but its taking Shaeljn Lauderdale PERMIT MUNICIP. #2 WBS PERMIT MUNICIP. #3 was

I need only name Shaeljn Lauderdale

@Puneet_Singh3 If PERMIT MUNICIP is constant throughout then you can use that as a Reference

@supermanPunch one more question
Please find attached regex screenshot. I had given in this way. Now pls help how to get the value in variable using this. I need to write the value in excel which has column name


SOrry for bothering

@Puneet_Singh3 No. I don’t think that will Work. Instead you can use separate Regex Expression to get each value in this way :
System.Text.RegularExpressions.Regex.Match(strInput,"(?<=ENGINEER:).*?(?=PERMIT MUNICIP)").Value.ToString.Trim

System.Text.RegularExpressions.Regex.Match(strInput,"(?<=PROJECT NUMBER:).*").Value.ToString.Trim

1 Like

@supermanPunch This value is not fixed ?(?=PERMIT MUNICIP)") it get changed and am facing issue when i going to read 2nd PDF

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.