Skip to main content
felixr
September 14, 2022
Solved

Is there a way of searching for a certain paragraph in a list of paragraph

  • September 14, 2022
  • 6 replies
  • 0 views

I have a list of paragraph  in one of those  there should be two key words  in separate  places  could  be one before another  for example sometimes  could be a text like this " hi  carls your property is  ready   you can verify in  96 days"  or the other way around " in 96  days  your new property would be ready" in this  case i would like to be able to find this two key word    and    get the exact paragraph  the key words  that will always be in this scenario are "property" and "## days" cause there are some paragraph that  could have one of this words but when we find them combined  it is a match. i was trying with regexarrayindexfirstmatch  but i could not make it work also i tried using  like() function  and find().

another thing all this  paragraph are coming form a PDF  file with  20 pages  more or less.and I'm getting them with the getpdftext() function.

is there any function or something that  could help  achieve this  efficiently cause  the only way  i find is looping a lot character by character in every single paragraph .

thanks in advance!

    Best answer by gabriele.camilli

    Hi,

    A solution (very dependent on the PDF formatting,tho) is to try to split the paragraphs using split(text,char(10)). If this works for you pdf, you could then loop on the paragraphs and check for both keyword in an AND statement to find the matching paragraph

    6 replies

    gabriele.camilli
    September 14, 2022

    Hi,

    A solution (very dependent on the PDF formatting,tho) is to try to split the paragraphs using split(text,char(10)). If this works for you pdf, you could then loop on the paragraphs and check for both keyword in an AND statement to find the matching paragraph

    felixr
    felixrAuthor
    September 14, 2022

    yes i got you but in my case   is not like i'm  looking for  an especific number  could be any number from  0  to 999  for example then is follows by the word days and  and also the paragraph need to  look for the other  word

    gabriele.camilli
    September 14, 2022

    Then one of the Find can be replaced by a regexmatch expression, to find number+" fixedstring", it seems that you have access to the plugin, right?