View Single Post
 
Old 02-19-2018, 11:08 PM
Robert Kay Robert Kay is offline Windows 10 Office 2016
Novice
 
Join Date: Feb 2018
Location: Australia
Posts: 4
Robert Kay is on a distinguished road
Default Code to find Numerical string etc

Thanks for your reply Paul. I am afraid your code doesn't work. As I understand it:
The "find" expression translates ^13 is code for the paragraph break - I don't understand the expression or function ^| - or is that a lower case L?.
I assume the [0-9]{1,} is to find a numerical string between zero and nine. What is the function of the numeral one in curly brackets? I gather the expression ^32 represents a space.
My understanding of the "replace" function is that it replaces the first element in the find expression (i.e. the \1) with a space. I don't want a space, I need a comma after the number represented by the numerical string. The numerical string can be any number (i.e. set of numerals comprising a number, between 1 and 99999. The numbers above 1000 are not comma delineated.

The following text is an example of the original document:

641 Beard, Ernest Noel, 31 Tennyson st., S.8, analyst, M
642 Beard, Suzanne Louise, 31 Tennyson st., S.8, sales; F
643 Beasley, Howitt, 72 Beaumaris pde., S.21, foreman, M
644 Beasley, Joyce Ivy, 18 Victory st., S.8, mechanic, F
645 Beaton, Flora Janet, 44 Sims st., S.8, home duties, F

I want the result of the macro to produce

641,Beard, Ernest Noel, 31 Tennyson st., S.8,,analyst, M
642,Beard, Suzanne Louise, 31 Tennyson st., S.8, sales; F
643,Beasley, Howitt, 72 Beaumaris pde., S.21, foreman, M
644,Beasley, Joyce Ivy, 18 Victory st., S.8, mechanic, F
645,Beaton, Flora Janet, 44 Sims st., S.8, home duties, F

Your advice would be appreciated
Reply With Quote