How to retrieve check box value from pdf using regular expressions

Hi All,
Does anyone know how to get selected check box value from pdf using regular expressions?
PDF
new
text extraction output:
image

Please share the text file @Lalitha_Selvaraj

Regards

Hi @Lalitha_Selvaraj

Please check the below regex expression and give a try and also if possible please share the text file.

0(?=\s+[A-Za-z0-9]+)

Regards

It looks like ## is for unchecked and 0 is for checked. So you could just check if the string contains it or not. E.g. to check if “25Yr” is checked, search for “0 25Yr”, if it exists, it’s checked. Otherwise if “## 25Yr” exists, it’s unchecked.

1 Like

Hi @vrdabberu. Thanks for the response. I’m sharing the text file below

sample textfile.txt (126 Bytes)

Expected result for this pdf: Product: T^25yr

Hi @Lalitha_Selvaraj

Please check the xaml attached:
Sequence18.xaml (10.7 KB)

Regards

Can you share the regular expression. I’m not able to access your .xaml file.

Hi @Lalitha_Selvaraj

Name = System.Text.RegularExpressions.Regex.Match(str_Text,"(?<=\d+\.\s+)([A-Za-z]+.)").Value.Trim

MatchesValue = System.Text.RegularExpressions.Regex.Matches(str_Text,"0(\s+[A-Za-z0-9]+)")

Below i have used in the message box :

Name+" "+String.Join("^",List)

Regards

Hi @Lalitha_Selvaraj

Is it working?

Regards

Hi @vrdabberu. I don’t have activity like “For each List and Append items to collection” . My UiPath version is 2021.4.4 . Do you have any alternate activity to do this task?

Hi @Lalitha_Selvaraj

You have to use For Each loop and You can find Add to Collections activity instead of Append Item to Collections activity. Can you share the dependencies version you are using?

Regards


I’m getting the above error. Can you help to resolve this. Can you send the pic of your properties section.

Hi @Lalitha_Selvaraj

Can you tell what have you given in Item and what is the datatype you have given for List. If possible share your .xaml file. I will help you in solving the error.

Regards


samplefile.xaml (8.6 KB)
Please find the attachment.

Hi @Lalitha_Selvaraj

Try giving the syntax like the below image in Add to collection:

In Collection please click on three dots click on Open in Advanced Editor and give the below syntax:

List.Cast(Of String)().ToList()

In Item please click on three dots click on Open in Advanced Editor and give the below syntax:

currentItem.ToString.Trim.Split(" "c).Last

Type Argument is System.String

Regards

Hi. I’m not getting the output
image
.xaml file image
image

Can you send the dependencies screen shot from Projects Panel. @Lalitha_Selvaraj

Try to update UiPath.System.Activities once and in Add to Collection try giving only List

Regards

Hi @Lalitha_Selvaraj

Keep Runtime Rule as Lowest As Applicable and click on Update and save the dependency.

In Collection pass only List in Add to Collection activity and check

Regards