I applied the condition which has been suggested by you guys.
I want the output of employee social number.This is the only section I want output as.
I applied the condition which has been suggested by you guys.
I want the output of employee social number.This is the only section I want output as.
Hi @Bhushan_Nagaonkar ,
Can you paste the text here after you read the pdf?, you can jumble the sensitive numbers in case of security issues.
Regards,
I want the number.
If you want the social security number which has a hiphen in it then try the following regex expression:
[0-9-]+
This will match numbers with hiphen in it, for eg xxx-xxxx
Regards,
The pdf has other data, also this is the only data I want from PDF. How should I do it?
Can you show me in ss format?
Thankyou
Hi @Bhushan_Nagaonkar ,
We will not be able to provide a proper regex if the Sample data format is not provided, However check the below regex :
(?<=social security number.*\s*)[\d-]+
@Bhushan_Nagaonkar , in the expression provided by @Gokul_Jayakumar , just change the regex pattern and you are good to go.
Assign it to any string variable
System.text.regularExpressions.Regex.Match("Your String","[0-9-]+").Tostring.Trim
Regards,
It worked thanks.
I just have one question what if I don’t use get text and just want to use readpdf
activity and assign it to regex to get the output how should I do it in this case.
@Bhushan_Nagaonkar , after you read the pdf pass the extracted string variable directly to the above expression.
Regards,
I tried but the output I got was 7 which was of other elements present in doc
Im getting an output but this is the error
Still same error
I will look for it. Sorry for late reply btw.
I have one last query. I need help in understanding if there are multiple document and sometime s the format is different how am I supposed to get output from it.
Above are two format. I wont be able to use get text. I will have to use read pdf and then pass read value from it. What is the regex method/condition for this?
@Manju_Reddy_Kanughula @vishal.kp @supermanPunch @ushu @Gokul_Jayakumar
Hi,
I guess i have written correct this time but the error is persisting.
Hi @Bhushan_Nagaonkar ,
Try this, using a for each loop you can get all the social security number matched:
System.Text.RegularExpressions.Regex.Matches(InputText,"(\d{3}-\d{2}-\d{4})").Item(0).Groups(1)
Regards,
What do those values represent and will the brackets will be included with that
@Bhushan_Nagaonkar , the social security number is 9 digits and in the format of xxx-xx-xxxx. Hence this pattern will be matching all the numbers appearing in that format. The brackets unclosing the pattern are just to get it to group 1, you can avoid the brackets in the pattern, the matches will be present in group 0.
If your question was about the square bracket, then just use .string at the end.
Regards,