Code to find numerical string + space throughout document & replace them with Comma
I am new to Word Macros. I am assisting a local historical society by scanning old electoral rolls for the area, performing OCR and then copying the data into excel tables so the data can be searched electronically.
The OCR process produces a .txt file which I then open in Word 16 so I can clean it up and comma delineate the fields of data.
The entries are:
Roll Number (space) Surname, Forenames, Address, electoral district,gender followed by a carriage return (paragraph mark).
My problem is to incorporate a sub routine (maybe not the correct technical term) to place a comma after the Roll Number which is a number between 1 and 99,999.
I have tried to use the find and replace function, (which I use to get rid of unwanted spaces and errors when the OCR program identifies . (periods) as commas.
I note the street address usually contains numbers as does the Electoral District.
Any assistance would be appreciated in formulating the appropriate code.
|