Extract specific text from string using Substring /Regex

Hi, I have attached the pdf pic and their extracted text.
physiciandet.txt (502 Bytes)


I need the physician/health care provider, Address and phone number which is having null values.(Note: it should not take the values of Physician details(the above one) - “k”,“7205”,“352”)
My expected output will be
a. physician/health care provider :
b. Address:
c. phone number:
Is there any way to handle this?

@Lalitha_Selvaraj

a. [A-Z a-z\/]+\:.
b.\s+[A-Za-z]+\:
c.\s+Phone Number:
d.\sDate\s.*\:

Please use this regex expressions i hope this works for you,If not please update me i will change the regex

@rlgandu . Thanks for the response.


I need to get the highlighted value alone which means it should not print the values eg.k

Hi @Lalitha_Selvaraj

Can you highlight the expected output from the image you have posted in the question.

Regex Pattern: a\.\s+[A-Z a-z\/]+\:

Regex Pattern: b\.\s+[A-Za-z]+\:

Regex Pattern: c\.\s+[A-Za-z ]+\:

Regex Pattern: d\.\s+[A-Za-z ]+\:

Regards

@Lalitha_Selvaraj

a. [A-Z a-z\/]+\:




1 Like

@vrdabberu . Please check this pic

Hi @Lalitha_Selvaraj

is the marked one required output from given text file.

Regards

@vrdabberu . this is the expected output.

@Lalitha_Selvaraj
Previously you said your output should be

My expected output will be
a. physician/health care provider :
b. Address:
c. phone number:

but the output in the screenshot above is little different you have extract 2nd column data also

Sorry for the confusion. I need the 2nd column data alone. here we have physician details twice. I need the second set of values.

@Lalitha_Selvaraj

(?<=Health\s*Care\s*Provider:\s+).*(?=b.)

(?<=Address:\s+).*

\d+(?=\sd.\s)

(?<=Last\s*Consulted:).*

@rlgandu . Please refer this pic

|