Chronology Current Month Current Thread Current Date
[Year List] [Month List (current year)] [Date Index] [Thread Index] [Thread Prev] [Thread Next] [Date Prev] [Date Next]

Re: word6 reformatting LFs



Thanks, John D. I used your suggestion and it worked very efficiently.
Ludwik Kowalski

John Denker wrote:

I have a long document in which there are CRs at the end of lines. I want to
remove all of them. Instead of doing this manually (line by line) I would
like to do this automatically. Is there a command for killing specified
ASCII characters in Microsoft Word6 for Mac?

There are several different scenarios that semi-fit this description. One
common case goes like this:

What LK is calling CR is (in this scenario) not an ascii CR; it is an
ascii LF which microsoft in its 1/infinite wisdom treats as a paragraph
break. Meanwhile (in this scenario) whoever wrote the document is using LF
to denote end-of-line (in compliance with ascii standards) and is probably
using double-LF to denote real paragraph breaks.

The only trick to cleaning up this mess lies in protecting the
double-LF. So the procedure is:
1) Do a search-and-replace, namely
find what: ^p^p (match double LF)
replace with: <**par**> (placeholder)
2) Do another search-and-replace, namely
find what: ^p (match remaining LFs)
replace with: (a single space)
3) Do yet another search-and-replace, namely
find what: <**par**>
replace with: ^p

If you want to get fancy, for added reliability you can add a step (0) to
get rid of gratuitous spaces before and after ^p (LF) characters.

=======

Note: This trick of temporarily renaming something to an
arbitrarily-chosen temporary value is high on the list of super-common,
super-useful techniques.

Note: The use of expressions like ^p to match special characters is
documented on the pulldowns on the search-and-replace popup.

==============

If I have guessed wrong about the scenario, please ask again with
additional detail.