At 20:37 Uhr -0400 13.06.2001, Katherine Richmond wrote:
>Hi everyone,
>
>I'm learning to use regular expressions. Would you please give me advice about
>how to proceed.
>
>Thanks,
>Kathy
>

[...]

>I am still left with ^ and CR-0. I can remove those. But, is there any way to
>preserve the formatting of the text? Much of the data is in multi-line, outline
>format. That looks awful without the carriage returns. I tried adding a \r at
>the end of each line from the input file. This is what the data looks like after
>I add an \r at the end of each line from the input file:
>
>Right peritoneal "tissue" (cell block section):^ 
> 1. Mesothelial cells, wbcs, and blood clot.^ 
> 2. No evidence of malignancy.^ 
>CR-0^ 
>
>BUT This is what it looks like after I import it into FileMaker:
>
>Right peritoneal "tissue" (cell block section):^ 
> 1. Mesothelial cells, wbcs, and blood clot.^ 
> 2. No evidence of malignancy.^ 
>CR-0^ 
>

Unfortunately, I can't see a difference between these two samples. However, adding a 
\r will not work. I'll forward a message to you, that was posted to this list just two 
days ago:

---- begin of forwarded message ----

From: Ronald J Kimball <[EMAIL PROTECTED]>
To: Adam Russell <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED]
X-Spam-Rating: onion.valueclick.com 1.6.2 0/1000/N
Subject: Re: [MacPerl] \r

On Tue, Jun 12, 2001 at 12:02:21AM -0400, Adam Russell wrote:
>  So, ok. I now know how to get a CR in MacPerl. However, why does MacPerl
> convert \r to \n ?

Oh, I see, I thought you were asking how to protect a carriage return
character when FTPing a script from Unix to Mac.


The usual way to print a line of text is like this:

print "Hello, world!\n";

On Unix, that'll end the line with a linefeed, which is the Unix newline.
On a Mac, though, the newline character is a carriage return.  Instead of
making people change that code to:

print "Hello, world!\r";

to run under MacPerl, MacPerl swaps the meaning of "\n" and "\r".  "\n" is
a carriage return, and "\r" is a linefeed.

And on Windows, "\n" is magically converted to a carriage return followed
by a linefeed, which is the Windows newline.

So, whereever you go, "\n" does what you mean, yielding the local newline.


If you want an actual carriage return or linefeed, regardless of
platform, you should use octal or hex escapes instead.  For example:

print SOCKET "Hello, world!\015\012";


Ronald

---- end of forwarded message ----


To be sure, add a \015 (CR) to your lines, not a \r (this gives you these ugly carets).


HTH.

Best regards,

--Thomas

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

Reply via email to