Search and Replace for lists

Hi there. 


We have integrated the document editor in our app and are using it to make changes in track changes format. We are working with legal documents and have a lot of bullets and lists within the document, which makes searching automatically tricky, given that there could be line breaks and clause numbers (1.1, 1.1.1, 2.1), etc, before the clause.


Here is what we have done so far:
- convert all the text in the contract and store this as DOC_TXT in txt format

- clean the SEARCH_CLAUSE with any numbers, bullets, and trailing spaces

- split the SEARCH_CLAUSE into single lines, find what index is the text in DOC_TXT, and retrieve the FIRST_INDEX and LAST_INDEX

- using the indexes, get the RETRIEVED_TEXT from DOC_TXT


Now, we need to either;

  1. select the text in the editor based on start and end index; OR
  2. search the RETRIEVED_TEXT in the editor using findall 


Both 1 or 2 are not working for us. 


Plus, once we have selected, we also need to replace this text with the REPLACE_TEXT. We have a basic replacement that works if the text found is simple enough and without any weird characters but fails if even a single spacebar is out of place because the search function doesn't work.

I have attached a ZIP file with a sample clause (in PDF), and SEARCH_TEXT and REPLACE_TEXT (in WORD).


Hope you can assist.




Attachment: Archive_95d0d216.zip

1 Reply

DS Dhanush Sekar Syncfusion Team November 22, 2024 02:35 PM UTC

Hi Nirbhay,


Could you please confirm if you would like to replace the list text? If so, please note that replacing list text in the document is not possible. The list text will be generated dynamically as content is added or deleted. Additionally, there is a limitation with the find and replace function; it only works within a single paragraph and does not extend across multiple paragraphs.


Could you provide more details about your requirements? This will help us better understand your needs.


Regards,

Dhanush S


Loader.
Up arrow icon