Am Dienstag, den 23.12.2008, 18:38 -0600 schrieb Barbara Duprey:
> Marc Santhoff wrote:
> > Hi Barbara,
> >
> > Am Dienstag, den 23.12.2008, 13:58 -0600 schrieb Barbara Duprey:
> >
> >> Earlier in the thread, John indicated that what he wanted was to find
> >> the last period (full stop) and eliminate everything after it. Too bad
> >> there doesn't seem to be a version of LOCATE to find the last instance
> >> of something rather than the first! A search direction parameter for it,
> >> or a LOCATELAST function, would be really handy, I'd think.
> >>
> >
> > If Johns data does not have sentences or parts separated by NL or CR
> > chars he could use sth. like:
> >
> > LEFT(TheString, POSITION ('.'+CHAR(10) IN TheString)+1)
-1
> > If there are concatenated sentences this would only work for double
> > newlines, leaving on extra NL:
> >
> > LEFT(TheString, POSITION ('.'+CHAR(10)+CHAR(10) IN TheString)+1)
-1
Looks better, left string of "position in String" minus one step to the
left.
> >> Can the REPLACE function take a concatenated string like
> >> CHAR(13)+CHAR(10), for example? Trimming the individual characters
> >> wouldn't be enough if they're interspersed with other "whitespace"
> >> characters.
> >>
> >
> > In theorie it should, although I'm not sure if the concatenation has to
> > be done with '+' or by '||' or maybe using CONCAT().
> >
> > HTH and Merry Christmas,
> > Marc
>
> Interesting, Marc - thanks. Not sure whether the data has CHAR(13),
> CHAR(10), or both for a new line, it may depend on the OS.
Data is stored in UTF8 inside HSQL - does anybody know the line ending
convention for utf8?
> But if I
> understand this, the second form you have here would work if there are
> no internal empty paragraphs, and an extra new line at the end of the
> data, right? Sounds promising!
Besides it's a little wrong (see above) that is what it should do. I did
not test anything, though.
Marc
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]