• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Frontbase CLOB newline problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Frontbase CLOB newline problem


  • Subject: Re: Frontbase CLOB newline problem
  • From: Chuck Hill <email@hidden>
  • Date: Wed, 12 Nov 2008 12:24:53 -0800


On Nov 12, 2008, at 12:19 PM, Lachlan Deck wrote:

On 13/11/2008, at 2:10 AM, Q wrote:

On 12/11/2008, at 5:52 PM, Lachlan Deck wrote:

@see java.util.regex.Pattern

On 12/11/2008, at 5:37 PM, Awbrey Hughlett wrote:

On Nov 12, 2008, at 12:33 AM, Q wrote:

String comments = aListing.additionalComments().replaceAll("\r? \n", "\\\\n")

That worked perfectly. Why is the question mark there?

@see java.util.regex.Pattern It means \r is optional.

So this will work for windows or unix styles. To also handle the old styles of \r only... i.e., to transform files from any platform this should work:
String comments = aListing.additionalComments().replaceAll("(\r? \n?){1,2}+", "\\\\n")

Hmm.. this isn't going to do what you think.

You're right. This will though
String comments = aListing.additionalComments().replaceAll("[\\r\\n] {1,2}+", "\\\\n");


or more boringly:
String comments = aListing.additionalComments().replaceAll("\r", "").replaceAll("\n", "\\\\n");

Neither is this.

Right again :-) Serves me right for speaking so quickly :-)

String comments = aListing.additionalComments().replaceAll("\r\n", "\n").replaceAll("\r", "\n").replaceAll("\n", "\\\\n");


It is enough to make a person want to write a formatter.  :-)

But I still wonder what someone is going to do with a text file with special characters replaced with normal ones...

Chuck


-- Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Frontbase CLOB newline problem (From: Awbrey Hughlett <email@hidden>)
 >Re: Frontbase CLOB newline problem (From: Richard Stephens <email@hidden>)
 >Re: Frontbase CLOB newline problem (From: Awbrey Hughlett <email@hidden>)
 >Re: Frontbase CLOB newline problem (From: Q <email@hidden>)
 >Re: Frontbase CLOB newline problem (From: Awbrey Hughlett <email@hidden>)
 >Re: Frontbase CLOB newline problem (From: Lachlan Deck <email@hidden>)
 >Re: Frontbase CLOB newline problem (From: Q <email@hidden>)
 >Re: Frontbase CLOB newline problem (From: Lachlan Deck <email@hidden>)

  • Prev by Date: Re: Frontbase CLOB newline problem
  • Next by Date: Re: Frontbase CLOB newline problem
  • Previous by thread: Re: Frontbase CLOB newline problem
  • Next by thread: Re: Frontbase CLOB newline problem
  • Index(es):
    • Date
    • Thread