Extract the first letter of each word

Hi all

I have a requirement to extract the first letter of each word as shown in the example below
input: abcd output: a
input: abcd efgh output: ae
input: abcd efgh ijkl output: aej
any help will be much appreciated

I'm on the 11g version of the db

Depends on your definition of a "word", but for example:

SQL> select trim(regexp_replace(' a abcd efgh ijkl','(\S)\S*\s*','\1'))
  2  from dual
  3  ;

TRIM(REGEXP_REPLACE('AABCDEFGH
------------------------------
aaei
 

Tags: Database

Similar Questions

  • How to take advantage of the first letter of each word in Mysql

    Hello

    I tried to put a large database where visitors have been botched when entering text. The main thing I want to do is to capitalize the first letter of each word in Mysql.

    I found the code below in PHP, but it continues to find an error on the TIME line:

    <? PHP ini_set ('display_errors, 1');? >

    <? php require_once('Connections/maison_connection.php');? >

    <? PHP

    $result = mysql_query ("SELECT column, id FROM table");

    While ($row = {mysql_fetch_array ($result))}

    $id = $row ['id'];

    $column2 = ucwords ($row ["column"]);

    $query2 = "UPDATE table SET column = ' $column2′ WHERE id = '$id" ";

    mysql_query ($query2);

    }

    ? >

    My table is called mailing list and the column name is called, so I modified the script to do this: but it still shows the same error while:

    <? PHP ini_set ('display_errors, 1');? >

    <? php require_once('Connections/maison_connection.php');? >

    <? PHP

    $result = mysql_query ("SELECT name, id FROM mailing list");

    While ($row = {mysql_fetch_array ($result))}

    $id = $row ['id'];

    $Name2 = ucwords ($row ['Name']);

    $query2 = "UPDATE LISTSERV SET name = ' $Name2′ WHERE id = '$id" ";

    mysql_query ($query2);

    }

    ? >

    Any ideas?

    
    

    The key is to use a multidimensional array. The first time the while loop runs through the database results, $i is 0, so the values are assigned to the $updates [0] ['id'] and $updates [0] ["Name"]. The following becomes $updates [1] ['id'] and $updates [1] ["Name"] and so on.

    The loop resets $i to 0, and uses count ($updates) to get the length of the array. It then updates each row by using $updates [0] ["Name"] and $updates [0] ['id'], $updates [1] ["Name"] and $updates [1] ['id'] and so on.

  • 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.

  • 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

  • First character of each word

    Hi all

    I want to get the first character of each word:

    If I "Statement analysis", so I want a query to return PBTS.


    Your help please

    Hello

    Here's one way:

    SELECT     REGEXP_REPLACE ( INITCAP ('Statement to be PARSED')
                     , '[^A-Z]'
                     )     AS inits
    FROM    dual;
    

    Output:

    INIT
    ----
    STBP
    

    INITCAP is an easy way to capitalize the first letter of each word (and ensure that no other letters begin with a capital letter).
    REGEXP_REPLACE is an easy way to delete all the characters except the captial letters.

  • Capitalize first letter of each new sentence

    Hi guys,.

    I'm working on a drawing or model for a magazine that, for now, I need to type a large number of texts in InDesign instead of copy - paste from word or...

    It made me a bit annoyed because I don't get uppercase every first letter of each sentence automatically like Word etc?

    So: How can I automatically uppercase the first letter of each sentence?

    Thank you very much

    Bob

    Edit/Preferences/correction auto/enable auto/correction correction automatic capitalization errors.

  • Get rid of the rule of the first letter in paragraph targeted

    Hello

    I have the following rule, which defines the color of the first letter of each of my paragraphs:

    p:first - letter {}

    make-weight: bold;

    Color: #F00;

    do-size: 36px;

    }

    I want one of my paragraphs to not have this style applied to it, so I assigned a class (< class p 'caveat' = >, the following:)

    #mainContent caveat {}

    background-color: #09F;

    color: #FFF;

    text-align: center;

    font size: large;

    make-weight: bold;

    }

    Unfortunately, she styles everthing in the rule except the rule of the first letter. This paragraph still seems to be to inherit this rule.

    How can I get rid of the rule of the first letter of the paragraph?

    Thank you

    Add

    {p.caveat:first - letter #mainContent

    color: #FFF;

    font size: large;

    }

    GRAMPS

  • 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

  • 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.

  • make the first line of each paragraph "BOLD"

    Hi all

    I read this forum, but I can't really find the answer, I need.

    Here's my problem, we intend to automate the flow of text in our Organization, that's what I have to do

    -read the input from the story of a database

    -flow text into a text box in particular for example 4.5 cm wide

    -each paragraph will be had 2 new lines

    -Select the first line of each paragraph then putting in bold.

    in the above list, I can do everything except the first paragraph selection and putting in bold. I am looking for the selection of text I see there is a function called textframe.select?

    Can someone help me with this please?

    This severely reduced your options. (Which reminds me, you can specify a detail important like that from the beginning the next time.)

    The simple solution would be to apply your "BOLD" font (or better: a character style) in the first line of each paragraph by using the property of a paragraph .lines. UH customary ‑‑ link to the HTML version of the omitted OMV, it seems I'm not coming back as much as CS2... (Is there a CHM for it to http://www.jongware.com/idjshelp.html).

    This should work:

    App.Selection [0] .paragraphs [0]. Lines [0] .appliedCharacterStyle = "YourBoldCharStyle";

    ... With your cursor in the paragraph you want to change. Will adjust to meet your specific needs.

    There is a drawback of the simple method. Unless you use a special police who makes bold with the same width as her (quite rare) usually, the text will be redistributed after he applied. So there are one or more words in bold on the next line, so you must remove the tank style "BOLD" of those. But! At that time InDesign may determine that these non-bold words may go back on the first line!

    Well written code does not help, because it could be possible the same word oscillates backwards with each change between the first and the second line, each time to cheat... At * some * point you'll have to help the poor ID a bit; perhaps to fix this first line with No Break applied.

  • 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

  • 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

  • It began to appear in the first inch of each merchant site I visit with the new version, "Congratulations!" Every $5 spent at JCPenney saves you a chance to win a $500 gift card. I have run scans and nothing appears not infected, but I do not understand t

    It began to appear in the first inch of each merchant site I visit with the new version, "Congratulations!" Every $5 spent at JCPenney saves you a chance to win a $500 gift card. I have run scans and nothing appears not infected, but I don't get that annoying block in Internet Explorer. I uninstalled and reinstalled firefox and when I did, the first thing is present at his inauguration was a message that says: "you have joined the shop now...". "something or another and I had to click OK, it was a microsoft OK message. How can I get rid of this?

    URL of affected sites

    http://www.BestBuy.com, target.com, any site of retail trade

    Your problem can be caused by Malware. You can run and update according to free anti-virus software:

    1. Malwarebytes (free version) - http://www.malwarebytes.org

    2. Spybot Search & Destroy - http://www.safer-networking.org

    3. Spyware Terminator - http://www.spywareterminator.com

    In addition, there are a number of forums, you can use to help get rid you of your infection. It is:

Maybe you are looking for

  • is more able to stream video from some sites after the upgrade to Safari 10

    After the upgrade to 10 Safari, I can no longer stream from a certain website. Instead of playing the video stream, I'm prompted to save "player.swf" as shown above.  This problem occurs on el Capitan, and it happens on the Sierra, and it all started

  • Satellite A40-221 - where to find the drivers for Windows XP?

    Hello everyone. I hope someone here can help me with my problem. I have old Toshiba laptop - Toshiba Satellite SA40-221, here it's picture . I reinstall windows xp and now I can't find the drivers. I have search on the official Toshiba web page and o

  • Tecra S5: Which driver Lan Wireless necessary

    Hello I have an S5 and receive information from a wireless Lan driver. Excellent service. But what is used? I follow the link for downloads and offers me different drivers. So I try to establish that you choose and that's where my problem begins. On

  • Beats Audio does not (HP Pavilion dv6-6c53er)

    Hello. earlier on my laptop (HP Pavilion dv6-6c53er) has been installed Windows 7 Home. But now I decided to upgrade my laptop. And changed the old Windows 7 Home for the new Pro Windows 8.1. All right. But after IDT HD Audio driver installation (wit

  • TDMS &amp; Diadem best practices: what happens if my mark has breaks/cuts?

    I created a LV2011 datalogging application that stores a lot of data to TDMS files.  The basic architecture is like this: Each channel has these properties: To = start time DT = sampling interval Channel values: Table 1 d of the DBL values After the