I am having 2 pdf with different values i have to specially extract those two values

pdf2
pdf 1

from these 2 pdfs from 1st pdf i have extract procedure date and from second pdf procedure date no time value
anyone can please help on this how to write regex value to get the procedure date: and rocedure date no time: values

Hi @Badda_Hemantha

1st PDF value

Assign activity -> Input = "Account #: 931868
                            Age: 64
                            Procedure Date No Time: 4/2/2024"

Assign activity -> ProcedureDateNoTime = System.Text.RegularExpressions.Regex.Match(Input,"(?<=Procedure Date No Time\:\s+)\d+\/\d+\/\d+").Value.Trim()

2nd PDF value

Assign activity -> Input = "Procedure Date: 4/1/2024:36 AM
                            Date of Birth: 3/21/1963
                            Gender: Female."

Assign activity -> ProcedureDate = System.Text.RegularExpressions.Regex.Match(Input,"(?<=Procedure Date\:\s+)\d+\/\d+\/\d+").Value.Trim()

Regards

at a time, we have to search both pdf values. either procedure date: or procedure date no time:

Do you want to extract the value according to Procedure Date No Time or Procedure Date. If these are present you need to extract the values right @Badda_Hemantha

Please specify.
Regards

yes, but the problem is 2 pdfs are in the one folder we to read those 2 pdfs one by one in loop and we have to get the Date No Time and Procedure Date

Hi @Badda_Hemantha

will you have both the values in both the PDF present in the folder. Please specify.

Regards

in one pdf we are having Procedure Date No Time and
in another pdf we are having Procedure Date
but the 2 pdfs are in same folder

Hi @Badda_Hemantha

The below syntaxes should work

If
  System.Text.RegularExpressions.Regex.IsMatch(InputText,"(Procedure Date\:\s+)\d+\/\d+\/\d+")
Then
    Assign activity -> ProcedureDateNoTime = System.Text.RegularExpressions.Regex.Match(InputText,"(?<=Procedure Date No Time\:\s+)\d+\/\d+\/\d+").Value.Trim()
End If
If
  System.Text.RegularExpressions.Regex.IsMatch(InputText,"(Procedure Date No Time\:\s+)\d+\/\d+\/\d+")
Then
     Assign activity -> ProcedureDate = System.Text.RegularExpressions.Regex.Match(InputText,"(?<=Procedure Date\:\s+)\d+\/\d+\/\d+").Value.Trim()
End If

If it matches, it will extract or it will proceed with further operations. Let me know if you have any queries

Regards

can you please send me condition value

@Badda_Hemantha

Conditions of 1st If:

If
  System.Text.RegularExpressions.Regex.IsMatch(InputText,"(Procedure Date\:\s+)\d+\/\d+\/\d+")
Then
    Assign activity -> ProcedureDateNoTime = System.Text.RegularExpressions.Regex.Match(InputText,"(?<=Procedure Date No Time\:\s+)\d+\/\d+\/\d+").Value.Trim()
End If

Conditions of 2nd If:

If
  System.Text.RegularExpressions.Regex.IsMatch(InputText,"(Procedure Date No Time\:\s+)\d+\/\d+\/\d+")
Then
     Assign activity -> ProcedureDate = System.Text.RegularExpressions.Regex.Match(InputText,"(?<=Procedure Date\:\s+)\d+\/\d+\/\d+").Value.Trim()
End If

Regards

can u try these patterns:
1- For “procedure date” (with time):

(\d{1,2}/\d{1,2}/\d{2,4} \d{1,2}:\d{2}:\d{2})

2-For “procedure date no time” (date only):

 (\d{1,2}/\d{1,2}/\d{2,4})