Re: Frontbase CLOB newline problem

2008-11-12 Thread Lachlan Deck
On 13/11/2008, at 10:04 AM, Q wrote: On 13/11/2008, at 6:19 AM, Lachlan Deck wrote: 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().replace

Re: Frontbase CLOB newline problem

2008-11-12 Thread Mike Schrag
String comments = aListing.additionalComments().replaceAll("\r\n", "\n").replaceAll("\r", "\n").replaceAll("\n", "n"); That should work, albeit in not the most efficient manner. I think we should all know by now that Q is basically always right on matters of insane complexity :) ms ___

Re: Frontbase CLOB newline problem

2008-11-12 Thread Q
On 13/11/2008, at 6:19 AM, Lachlan Deck wrote: 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

Re: Frontbase CLOB newline problem

2008-11-12 Thread Chuck Hill
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.additiona

Re: Frontbase CLOB newline problem

2008-11-12 Thread Lachlan Deck
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 wo

Re: Frontbase CLOB newline problem

2008-11-12 Thread Mike Schrag
String comments = aListing.additionalComments().replaceAll("(\r\n| \r)", "n"); To achieve what lachlan was aiming for, ie. replace \r, \r\n or \n with the string '\' + 'n', you would still need to match the \n case. Oh, my bad ... he's actually ESCAPING it, not replacing with \n ... That

Re: Frontbase CLOB newline problem

2008-11-12 Thread Q
On 13/11/2008, at 1:16 AM, Mike Schrag wrote: String comments = aListing.additionalComments().replaceAll("(\r?\n| \r)", "n"); Just to continue this discussion unnecessarily, but you might as well drop the ? from this, right? You really only care about \r\n, not bare \n's, so you could

Re: Frontbase CLOB newline problem

2008-11-12 Thread Mike Schrag
String comments = aListing.additionalComments().replaceAll("(\r?\n| \r)", "n"); Just to continue this discussion unnecessarily, but you might as well drop the ? from this, right? You really only care about \r\n, not bare \n's, so you could make it a little easier and just have: String c

Re: Frontbase CLOB newline problem

2008-11-12 Thread Q
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 m

Re: Frontbase CLOB newline problem

2008-11-12 Thread Awbrey Hughlett
Thank you all very much for the pointers. Awbrey On Nov 12, 2008, at 1:52 AM, 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", "\

Re: Frontbase CLOB newline problem

2008-11-12 Thread Lachlan Deck
@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

Re: Frontbase CLOB newline problem

2008-11-11 Thread Johann Werner
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.

Re: Frontbase CLOB newline problem

2008-11-11 Thread 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"); Ar

Re: Frontbase CLOB newline problem

2008-11-11 Thread Q
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

Re: Frontbase CLOB newline problem

2008-11-11 Thread Awbrey Hughlett
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", "\

Re: Frontbase CLOB newline problem

2008-11-11 Thread Awbrey Hughlett
On Nov 11, 2008, at 11:46 PM, Chuck Hill wrote: On Nov 11, 2008, at 3:39 PM, Awbrey Hughlett wrote: I am trying to print out a text document with data from a CLOB in Frontbase. Print out, as in to an HTML page? No, I am printing it out to a text document available for download as in e

Re: Frontbase CLOB newline problem

2008-11-11 Thread Richard Stephens
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 thi

Re: Frontbase CLOB newline problem

2008-11-11 Thread Chuck Hill
On Nov 11, 2008, at 3:39 PM, Awbrey Hughlett wrote: I am trying to print out a text document with data from a CLOB in Frontbase. Print out, as in to an HTML page? 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 return

Re: Frontbase CLOB newline problem

2008-11-11 Thread Mitchell Smith
t; Sent: Wednesday, November 12, 2008 9:39 AM Subject: Frontbase CLOB newline problem 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

Frontbase CLOB newline problem

2008-11-11 Thread Awbrey Hughlett
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.ad