if this is the case then yes, my "walking" method will work.
However you need to work out what to do with the <return> characters (line feeds) that are in your original example.
Are they really present in the text you will process?
The example you gave in your original post only required the <returns> to be deleted (removed) as the end of each line was actually <space><return>.
If you run a...
Code: Select all
replace return with space in TheText
You will end up with double spaces!
If you do not know what will be there you could try
Code: Select all
replace return with space in TheText
replace " " with " " in TheText
This means though that the resulting transformed text will be all on one line!
If you look at the text you want processing you may see there are double line breaks that you want to keep.
If this is the case you need to conserve those.
One way to do this would be
Code: Select all
replace return&return with "******" in TheText --preserve dble return breaks
replace return with space in TheText--get rid of the single returns
replace " " with " " in TheText--collapse dble spaces to single
replace "******" with return in TheText--restore the dble breaks as a single break
The above four replace statements can also be done using regex.
Might be faster. The principle is the same.
All this is a long winded way of say you need to do this before using my routine.
James