Printable Version of Topic

Click here to view this topic in its original format

UtterAccess Forums _ Microsoft Word _ Advanced Search & Replace With Original Number Plus 1

Posted by: likajoho Jul 3 2019, 12:57 PM

Is there a way to find a specific text followed by a number and then replace with the text and the number increased by 1?

i.e. I want to find the phrase "doc32" and replace it with "doc33", and replace "doc33" with "doc34", etc.

FYI the term is not at the end of the line and each instance is interspersed within other text.

Thanks you for your time considering this.

Posted by: DanielPineault Jul 3 2019, 02:44 PM

Can you supply a couple real examples of phases and expected final results.

In the example you provided, are you wanting to find all instances of doc# and index the #? So you will know the textual component of the word and want to index all instances found? Is this for a selected region, the entire document?

Posted by: likajoho Jul 3 2019, 10:35 PM

Thank you for replying, Daniel.

I have a text file that refers to over 100 images grouped into 65 documents (a probate file transcription and abstract]. I find that one of the images named "....doc32a.jpg" followed by "...doc32b.jpg" and "...doc32c.jpg" should be its own document by itself. "...doc32b.jpg" should be "...doc33a.jpg" and "...doc32c.jpg" should be "...doc33b.jpg". All the following file names should also be changed.

BTW, I refer to these file names in two other text files, so that would be a lot of manual changing. I've copied the information from "...doc32b.jpg" and down into a MS Word document. Hoping there is a way to do this a little more automatically with some type of search and replace like: search for "doc##" and replace with "doc##+1"

You asked for a sample.
Each image document info and transcription is preceded by "====="
Each image/page is preceded by "-----"
The abstract is preceded by "~~~~~"
So the info for image 32b looks like:

[info for image 32a]
paper 2 & 3 [likely attached]
image 300 of 1820
Jones Seaborn probate 1863 MS MonroeCo pkt1205 doc32b.jpg
[Downloaded as Jones Seaborn probate 1863 MS MonroeCo pkt1205 doc065.jpg