Letters the first letter of sentence

Hi all

I use 10g Enterprise Edition Release 10.2.0.5.0

I would like to convert this string:
it's a phrase one another... yet another.
in
This is a sentence. Another... Umpteenth.
with capital letters at the beginning of the text and after any point (just looking at full stops at the moment).

I'm having a problem with regular expressions in this functions applied to the backreferences are applied for the literal text rather than the back reference.

for example:
Wrote file afiedt.buf

  1  with t as (select lower('this is a sentence. another one... yet another.') txt
  2               from dual)
  3       select regexp_replace(txt,'(\.+ +)([[:alpha:]])','\1'||upper('\2'))
  4*      from t
13:13:36 SQL> /

REGEXP_REPLACE(TXT,'(\.++)([[:ALPHA:]])','\1'||UPPER('\2'))
-------------------------------------------------------------------------------------
this is a sentence. another one... yet another.

1 row selected.
This does not succeed the upper() function is applied to the string literal "\2" rather than the appropriate alpha character.

I'm really hoping to avoid resorting to splitting the string using instr and re - concatenate together again, but what it really takes.

Yes, I Googled, but I had trouble finding references that refer to initcaps()

I'm very frustrated that I can't seem to figure it out myself. any help?

in case anyone cares, last night, when I was at Midway through a glass of single malt, I wrote the following frustration, making what I want:
SQL> with t as (select 'this is my lowercase sentence. it looks... bad.' txt from dual)
  2  select replace(sys_connect_by_path(let,'~'),'~') sentance
  3    from (
  4          select lvl
  5                ,letter
  6                ,decode(lag(fsind) over (order by lvl)
  7                        ,'1'
  8                        ,upper(letter)
  9                        ,letter
 10                      ) let
 11           from (
 12                 select lvl
 13                       ,letter
 14                       ,last_value(fs ignore nulls) over (order by lvl range unbounded preceding)
 fsind
 15                    from (
 16                 select level lvl
 17                       ,decode(level
 18                              ,1,upper(substr(txt,level,1))
 19                              ,substr(txt,level,1)) letter
 20                       ,case when substr(txt,level,1) = '.'
 21                                   then 1
 22                             when regexp_instr(substr(txt,level,1),'[[:alpha:]]') = 1
 23                                   then 0
 24                             else
 25                                  null
 26                       end fs
 27                   from t
 28                   connect by level <= length(txt))
 29                  )
 30        )
 31   where connect_by_isleaf = 1
 32   start with lvl = 1
 33   connect by lvl = prior lvl + 1
 34  /

SENTENCE
----------------------------------------------------------------------------------------------------
This is my lowercase sentence. It looks... Bad.

1 row selected.

Hello

It's the kind of thing I would write a PL/SQL function.

If you know a substring that never happens in the text (say "~"), then you can:
(1) change all spaces to ' ~ 0'
(2) when there is a number of consecutive ' ~ 0 after an end of sentence punctuation, then change the last of them in a space
(3) use INITCAP
(4) change others ' ~ 0 in spaces

SELECT     REPLACE ( INITCAP ( REGEXP_REPLACE ( REPLACE ( txt
                                   , ' '
                                   , '~0'
                                   )
                            , '([.?!](~0)*~0)([[:alpha:]])'
                            , '\1 \3'
                            )
                 )
          , '~0'
          , ' '
          )          AS cap_txt
FROM     t
;

I don't know how you can manage abbreviations, for example "example."

Tags: Database

Similar Questions

  • letters the first letter

    I'm trying to normalize the names in my report, just uppercase the first letter, but I get an error, it doesn't seem to like the-1. Maybe there is a simpler way to do...

    upper (left (Contact." ((Contact First Name", 1)) | right (bottom (Contact." Contact first name"), length (Contact." ("Contact name") - 1).

    Hi, instead of right() function, you can also use the substring argument for the second part, your formula will look like this:

    upper (left (Contact." ((Contact First Name", 1)) | lower (substring (Contact." ((Contact First Name"2))

    Best regards, Tim

  • How the auto uppercase the first letter of each sentence

    I use the latest version of the Pages on the Sierra of the OS and I am trying to find a way to automatically capitalize the first letter of each sentence with nothing doesn't. I've been a user of Pages for years and every time announced a new update is all what I care about is adding this feature simple but important. So, now that the new update is here I can not yet understand how to take advantage of the auto and I can't find workarounds online to help me do it. Any idea?

    You can use WordService from DEVONtechnologies, free in the Mac App Store. You can then go to System Preferences > keyboard > shortcuts > Services & enable those you want. You can then select the text you want to apply the service to & go to Pages > Services & select initial caps of sentences. It is also possible to assign a keyboard shortcut to services. With the help of this device, or similar functionality in any word processing application still not to revert to words in a sentence that should be capitalized as 'I' or pronunciations. You will also have the problem of it capitalized words after the period for the abbreviation.

    I do it the traditional way, using the SHIFT key when necessary. It is advisable to learn to type using the SHIFT key, rather than relying on the software to do it for you. Just like the use of a spellchecker. It's good, but it will not go back on the words that are spelled correctly but not the correct spelling of the situation.

  • Capitalize the first letter of a sentence in a Textfield

    What is the best way to get a Textfield to behave like those for the first/last name in the addressbook?

    What I want is a field which:

    Capitalizes the first letter in uppercase

    Capitalizes the first letter in uppercase after each point or the dot & space

    allows the user to change it manually again.

    It seems so easy, but in fact is not. I thought about creating some statemachine for her, but it is much more complicated than it seems.

    The javax.microedition.lcdui.TextField has the INITIAL_CAPS_SENTENCE filter, but using this field isn't really an option, because it does not inherit from the RIM material and cannot be added to the managers (or anything else in my code also)

    help please

    Use ActiveAutoTextEditField.

  • How to select files in a directory by typing the first letter of the name as in 95 - &#62; XP

    How to select files in a directry by typing the first letter of the name as in XP

    Something has changed on my copy of Vista 64 bit Home Premium edition, and now when I try to type the first letter of a name of file to access it, rather Vista puts in the search box in the upper right corner of the window.

    It's counterproductive and annoying _ out of me. I want to jump for filenames beginning with that letter, not clear the screen and show the stuff that is not in the current directory. Especially since I regularly work with earlier versions of windows.

    How should I do so that I can type in the names of files in Explorer and jump to files beginning with this letter as in all previous versions of Windows since at least win95?

    Go to start / Control Panel / folder Options / view and scroll down where it presents two options when entering in the list view.  Check the box to select the item type in the view.  This is part of what you want.

    If you type a letter, it will go to the files/folders starting with this letter (and not the search box); However, I just tried it myself and it seems to work only for the first letter.  If you type in a second letter, he will then the files/folders starting with THIS letter instead of files that begin with the first letter typed and then refining to files beginning with the two first letters typed and so on.  I can't make it work any better than this - unless I type really fast (and it seems to work as it should most of the time).  And I want really fast.

    I hope this helps.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • How can I configure FF to start typing before? Such as if I am on a Web Site that needs my personal info, I put in the first letter of my email and FF puts the rest?

    How can I configure Firefox to start typing before? Such as if I am on a Web Site that needs my personal info, I put in the first letter of my e-mail and Firefox puts in the rest of the letters? IE has implemented this. It makes just so typing more easy to personal information.

    Firefox has a 'rudimentary' fill or "AutoComplete" feature, which is linked to the history of form and research.

    https://support.Mozilla.org/en-us/KB/control-whether-Firefox-automatically-fills-forms

    https://support.Mozilla.org/en-us/KB/Firefox-doesn ' t-economy-web-form-entries

    Users should be cautious to they clear recent history what they deselect Form & Search History; This data is stored in its own cache and not saved in a data file.

    As Fred mentioned, using an 'auto fill' extension is preferred by many users. This type of extension allows user implement their data of a personal nature and then to have this 'auto fill' information as required on the Web page "Forms."

    Currently, the most popular "auto-fill" extension seems to have disappeared of Addons,Mozilla.Org site in the last day or two. I had seen a number of threads of support on a compatibility issue in Firefox 50 with this extension; and I suspect that the developer he shot the AMO site. Not sure if this developer will solve the compatibility problem (probably several processes) prepares a new extension to the new format of WebExtensions, or that it is right to give up with his "auto-fill" extension I saw it listed in the AMO Tuesday; Today, it's gone.

    Personally, I have little use for this type of extension, but I don't use and provide suggestions of development (aka criticize what they were doing, FRO the view of "long term user") for a "auto-fill" extension of return in 2004 in the run-up to the release of Firefox 1.0. These developers have created what I would call an add-on "cutting edge", but ran into problems of compatibility silly every week because of Mozilla. And by the time Firefox 1.5 came out 6 months later and 1.5 changes to this extension, developers just gave and 'we' lost this particular extension. After using the 'ultimate auto-fill' extension I've tried a few others, but they have failed in comparison; and since my need was not great I just stuck with the function 'auto' by default.

    It's a real shame that Mozilla has not seen fit to extend these basic features "AutoComplete" over the past 10 years; but hey, it's software development! Redo the UI repeatedly and ignore the basic features; who looks better on a RESUME "as"scut"work that few potential employers will enjoy.

  • How to make the first letter in a capitalized text field

    Is it possible for me to make the first letter of a capital of field if the user forgets to make capital? For example, in my form there is a field for the first name. I would like to enter into some type of Java script, so when the user off the field and the first letter tabs is not crucial, it will make capital. If I don't have to use Java Script, that will be fine too.

    Hello

    If it's just a word value, you can use this in the event exist;

    this.rawValue

    = util.printx (">?")<>

    This changes the first character (represented by the?) uppercase (represented by the >) and all the characters of tail (represented by the *) lowercase (represented by the)<>

    If you wanted something more general... If they could also enter a middle name, then you can call a function such as;

    function

    toTitleCase (textValue)

    {

    return

    () textValue.toLowerCase replace (/ \b [a - z] / g, function replace (match) {return match.toUpperCase () ;});})

    }

    This example uses a regular expression to change all lowercase letters, following a word uppercase boundary.

    Bruce

  • My Whatsapp stopped suggesting words when I type the first letter how can I turn that back on FRO my six phone

    My WatsApp has stopped which suggests words when I type the first letter (s) how can I turn that on the back for my six phone more?

    Try: Settings > general > keyboard > predictive

  • If someone checks the mail from yahoo to my computer, their code is displayed if the first letter from my ID is the same with theirs. How can I delete their history on my computer?

    If someone checks the mail from yahoo to my computer, their code is displayed if the first letter from my ID is the same with theirs. How can I delete their history on my computer?

    Hey ioanaatc,

    Go in Tools > Options > Security tab click on passwords saved. This will give you a list of sites that you have saved passwords yahoo just find and delete other connections

    There are a lot of useful information in this article on the Firefox Password Manager. He should answer any other questions you might have.

    It can be saved as Auto form fill data. If this is the case, the article I just linked will show you you how to remove these entries as well.

    Hope this helps!

  • Double capitalizing the first letter of the community don't

    Eevery time I post in these forums of the community on my Pro 9.7 "iPad in Safari, it capitalizes and duplicates the first letter. I keep coming back and fixing it in my usual posts, but I left it on this post if you could see what I mean. No other page in Safari does that. The community of Apple Support alone. I tried all the standard fixes (restart, shut down Safari, etc.), but it looks like he may have to do with the site itself. I noticed other people with this same event messages, it's not just me. Thoughts?

    Interesting. I've alerted the hosts to your message.

  • My saved favorites does not appear on the html bar when I typed the first letter! He appeared and now it does not work! How and what do I do?

    Help! My saved favorites does not appear when I type in the first letter. For an example, I saved "www.facebook.com" as one of my favorites. Whenever I go into facebook, I'll just enter the letter 'f' and he goes, a drop down link in the html bar then I'm leaving for facebook! But recently there have not been showing bookmarks I saved. I reinstalled firefox and it does not solve the problem at all. How and what do I do?

    Make sure that the address bar is not set to 'Nothing': Tools > Options > privacy > address bar: when you use the location bar, suggest: history, bookmarks and bookmarks - see Smart Location Bar

  • Safari truncates the first letter of the email address.

    Something new in Safari. When I type my e-mail address in a field he deletes the first letter of my e-mail address and I have to manually replace. Is this a problem with AutoCorrect? In the contact e-mail address has not changed.

    The spell checker can be falsely correct the entry. Please select the incorrect entry and click or control. In the context menu, select

    Spelling and grammar ▹ display spelling and grammar

    A small window will open. In the top text box, enter the correct text, then click on change and close the window.

  • In Outlook Express, when I type in the first letter of an e-mail address that is in my contacts, the dropdown does not close when I click the right address.

    Original title:

    Under XP, when I type in the first letter of an e-mail address that is in my contacts, the dropdown does not close when I click the right address. What a nuisance! Also, when I go to create a new e-mail message, an address of my contacts appears in no particular place, making it impossible to complete the message.

    Hello

    I suggest you turn off Auto complete and then check if you face the same problem.

    a. open Outlook Express.

    b. click on Tools.

    c. click on Options.

    d. click the send tab.

    e. uncheck the e-mail address automatically complete when composing box.

    f. click OK.

    Turn Auto complete and test again to see if the behavior is better. To activate it again, follow the same steps as above, but put a check mark in the box.

  • whenever I write the first letter of search in google the screen pops up

    whenever I write the first letter of search in google the screen pops up

    on the right side of your screen of google it is parameter option for google page click on it select search asking to go to the bottom of the page use (do not use Google Instant) and down click on save preferences now you are good to go...

    Good luck

    Firoz

  • On Windows 7, how to implementing automatic uppercase the first letter of the first book and the first letter after each period?

    I'm using Windows 7, how do I configure my system automatically capitalized the first letter of the first word and the first letter after each period?

    Thank you

    Lisa.

    Hello Lisa,.

    It's more to do with the word processor on Windows. You don't say what word processing software you use. If you use WordPad which comes free with Windows, it is impossible to do what you want to do. However, if you are using Microsoft Office Word (that you can buy) then the CAP is set by default.

    This forum post is my own opinion and does not necessarily reflect the opinion or the opinion of Microsoft, its employees or other MVPS.

    John Barnett MVP: Windows XP Expert associated with: Windows Expert - consumer: www.winuser.co.uk | vistasupport.mvps.org | xphelpandsupport.mvps.org | www.silversurfer-Guide.com

Maybe you are looking for