• 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: Johann Werner <email@hidden>
  • Date: Wed, 12 Nov 2008 07:53:32 +0100


Am 12.11.2008 um 07:37 schrieb Awbrey Hughlett:


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


On 12/11/2008, at 4:24 PM, Awbrey Hughlett wrote:


On Nov 12, 2008, at 12:14 AM, Richard Stephens wrote:

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


Are you sure you don't mean
String comments = aListing.additionalComments().replaceAll("\n", "\\n");
comments = comments.replaceAll("\r", "\\n");


But this would leave you with double "\n"'s in your output. Maybe try
String comments = aListing.additionalComments().replaceAll("\r \n", "\n");
comments = comments.replaceAll("\n", "\\n");


This is probably the simplest solution and should work fine provided you don't have any input with just \r's.



This got me closer

returned value in the .txt document is:
Testing the new linenncarriage return replace methodnnfor the text download.

Try this:

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

That worked perfectly. Why is the question mark there?

That is part of a regular expression and means that it searches for an expression with zero or one '\r' in front of '\n'.
For more info look at http://en.wikipedia.org/wiki/Regex


jw

Thanks a lot,
Awbrey



Regards,
Richard Stephens
Ph: 07 3136 3426
Mob: 0410 111 570
Email: email@hidden


On 12/11/2008, at 9:39 AM, Awbrey Hughlett wrote:

I am trying to print out a text document with data from a CLOB in Frontbase. In my code, I get the data and set it to a string value. What I want to do is get rid of all line breaks and carriage returns. So here is what I have tried and the results that follow:

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

result:
Testing the new line
n
ncarriage return replace method
n
nfor the text download.


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


result:
Testing the new linen
n
carriage return replace methodn
n
for the text download.

from this I decided it might have both carriage returns and line breaks so ...
String comments = aListing.additionalComments().replaceAll("\n", "\\n");
comments = aListing.additionalComments().replaceAll("\r", "\\n");


result:
Testing the new linen
n
carriage return replace methodn
n
for the text download.


I want the result to be:
Testing the new line\ncarriage return replace method\nfor the text download


Can anybody give me a hint please?

Thanks,
Awbrey
_______________________________________________
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


_______________________________________________ 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



-- Seeya...Q

Quinton Dolan - email@hidden
Gold Coast, QLD, Australia (GMT+10)
Ph: +61 419 729 806




_______________________________________________ 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

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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>)

  • Prev by Date: Re: Frontbase CLOB newline problem
  • Next by Date: Re: JNDI Datasource vs JDBC (Tomcat deployment)
  • Previous by thread: Re: Frontbase CLOB newline problem
  • Next by thread: Re: Frontbase CLOB newline problem
  • Index(es):
    • Date
    • Thread