[EMAIL PROTECTED] wrote:
On Sun, 02 Dec 2007 15:54:03 +0000, Harold Fuchs
<[EMAIL PROTECTED]> wrote:

On 02/12/2007 15:38, [EMAIL PROTECTED] wrote:
On Sun, 02 Dec 2007 15:35:20 +0000, Harold Fuchs
<[EMAIL PROTECTED]> wrote:

On 02/12/2007 14:34, [EMAIL PROTECTED] wrote:
I have a really strange thing going on.
I have a text document that has a carriage return at the end of each
line.  I get these often, and usually I just do a search and replace
to remove them.
This time, if I use "find" and then "replace" it works fine.  But if I
just select "replace all" it simply deletes the highlighted paragraph
(I do have "current selection only" checked).  I don't want to do it
on the entire document -- there is formating in the first ten pages or
so that it messes up if I do that.
I can, of course, just keep clicking "find" and then "replace" but
since this document is over 150 pages, that's going to take awhile.
I've done this hundreds of times and never had this happen.  I've
downloaded the most recent OOo version, but haven't installed it yet,
so there haven't been any changes since the last time I did this. Does anyone know what's going on?
TIA
What Regular Expression are you using?
It happens with both "$" and with "\n"

Hmm. I'm using OO 2.2 on Win XP Pro and the fin/replace "$" is fine but it can't find "\n". This is in a .odt document; same in a .txt document. So, sorry, I have to utter the hated phrase "cannot reproduce your problem".

Thanks for trying.
Figuring I had nothing to lose, I went ahead and installed the latest
release, but I'm still having the same problem.  This is totally
baffling.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

I have occasion to do this from time to time, and I have found it much simpler to do it to the text file BEFORE I open it with OO. The following is a solution I use on Linux, but it could be adapted to Windows if that is what you are using (find NAWK for Win). On my system the 2 files are in $HOME/bin which is in my $PATH. It works pretty well, creates a new text file with one (very long) line per paragraph. It assumes that either an indent or a blank/null line signals a new paragraph.

OO is great, but sometimes a different tool does the job better.

makedoc:
awk -f ~/bin/flowdoc.awk $1.txt >otherformats/$1.doc

flowdoc.awk:
BEGIN     {bfr = "";
          }
/^[ ]*$/  { if (length(bfr) > 0)
              { print bfr;
                bfr = "";
              }
            next;
          }
/^$/      { if (length(bfr) > 0)
              { print bfr;
                bfr = "";
              }
            next;
          }
/^     /  { if (length(bfr) > 0)
              { print bfr;
                bfr = "";
              }
            for (ix = 1;ix <= NF;ix++)
                bfr = bfr $ix " ";
            next;
          }
          { for (ix = 1;ix <= NF;ix++)
                bfr = bfr $ix " ";
            next;
          }
END       { if (length(bfr) > 0)
              print bfr;
          }

Jim Hartley
--
Teen Angel - a ghost story - http://teenangel.netfirms.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to