Team,
How to find a specific word which are extracted from a pdf using string ?
For Ex i have extracted a set of data in that i need to find the word ‘Due’ and extract the amount next to it.
Due $50
Output should be $50.
Team,
How to find a specific word which are extracted from a pdf using string ?
For Ex i have extracted a set of data in that i need to find the word ‘Due’ and extract the amount next to it.
Due $50
Output should be $50.
Try the following regex agains the string : (?<=Due )(\$\d*)
The output will be the 1st capturing group.
Also see https://regex101.com/ for testing.
Hi @Robotics,
The perfect approach for this is use of Regex.
For an example:
regex101: build, test, and debug regex - from here you can catch “Due” word and use it
regex101: build, test, and debug regex - from here you can get amount for the same string.
use split like this buddy @Robotics
Once you get the text from pdf with output variable named out_text_pdf try like this buddy
This would give $50 alone buddy
Thats all you are done
Cheers @Robotics
Did that work buddy @Robotics
@ Palaniyappan : I am getting the below said error
item.split(“Due”)(0).ToString.Trim - ‘Compiler Error encountered processing expression. Option StrictOn disallows late binding’
Fine get like this buddy @Robotics
item.ToString.Substring(3,item.ToString.Length-3)
Were you able to get now buddy
@Robotics
No. After reading the pdf in Assign i have given the below line
Buddy kindly use a message box before splitting and after reading pdf inorder to check whether pdf is first read or not, as you are going good so far, lets make sure that
we get data from pdf buddy @Robotics
as @RobertD this will work for you - simple and easy
Sample - RegexSample.xaml (6.6 KB)
Regards…!!
Aksh
@Palaniyappan. I am able to read the contents from pdf in msg box.
I guess this does not work - out_text_pdf.Substring(“Due”.Length)
I am assigning this to a variable and trying to print in msg box which returns
the entire content which is present in pdf. Attached the sample pdf.
wordpress.pdf (42.6 KB)