Count space in word

hi how can i count alphabet in a letter for example if i have word simple how can i write query to show that simple got 5 alphabat and count the space if its there

It would help if you were clear in what you want. Please read: {message:id=9360002}
Here's an example of the sort of thing you could do if you wanted...
SQL> drop table t
  2  /
Table dropped.
SQL>
SQL> create table t as
  2    select 'SUPERCALAFRAJALISTICEXPIALIDOCIOUS' as txt from dual union all
  3    select 'THISISMYVERYLONGNAME' from dual union all
  4    select 'SIMPLE 123' from dual
  5  /
Table created.
SQL> with chrpos as (select t.txt, SUBSTR(t.txt,x.rn,1) as chr, x.rn as pos
  2                  from   (select rownum rn from dual,t connect by rownum <= length(t.txt)) x, t)
  3  select txt, chr, cnt, ltrim(sys_connect_by_path(pos,','),',') as positions
  4  from (
  5        select c.txt, c.chr, c.cnt, c2.pos, row_number() over (partition by c.txt, c.chr order by c2.pos) as rn
  6        from (
  7              select c1.txt, c1.chr, count(*) cnt
  8              from chrpos c1
  9              group by txt, chr
10             ) c,
11             chrpos c2
12        where c2.txt = c.txt
13        and   c2.chr = c.chr
14       )
15  where connect_by_isleaf = 1
16  connect by txt = prior txt and chr = prior chr and rn = prior rn+1
17  start with rn = 1
18  order by txt, chr
19  /
TXT                                C        CNT POSITIONS
SIMPLE 123                                    1 7
SIMPLE 123                         1          1 8
SIMPLE 123                         2          1 9
SIMPLE 123                         3          1 10
SIMPLE 123                         E          1 6
SIMPLE 123                         I          1 2
SIMPLE 123                         L          1 5
SIMPLE 123                         M          1 3
SIMPLE 123                         P          1 4
SIMPLE 123                         S          1 1
SUPERCALAFRAJALISTICEXPIALIDOCIOUS A          5 7,9,12,14,25
SUPERCALAFRAJALISTICEXPIALIDOCIOUS C          3 6,20,30
SUPERCALAFRAJALISTICEXPIALIDOCIOUS D          1 28
SUPERCALAFRAJALISTICEXPIALIDOCIOUS E          2 4,21
SUPERCALAFRAJALISTICEXPIALIDOCIOUS F          1 10
SUPERCALAFRAJALISTICEXPIALIDOCIOUS I          5 16,19,24,27,31
SUPERCALAFRAJALISTICEXPIALIDOCIOUS J          1 13
SUPERCALAFRAJALISTICEXPIALIDOCIOUS L          3 8,15,26
SUPERCALAFRAJALISTICEXPIALIDOCIOUS O          2 29,32
SUPERCALAFRAJALISTICEXPIALIDOCIOUS P          2 3,23
SUPERCALAFRAJALISTICEXPIALIDOCIOUS R          2 5,11
SUPERCALAFRAJALISTICEXPIALIDOCIOUS S          3 1,17,34
SUPERCALAFRAJALISTICEXPIALIDOCIOUS T          1 18
SUPERCALAFRAJALISTICEXPIALIDOCIOUS U          2 2,33
SUPERCALAFRAJALISTICEXPIALIDOCIOUS X          1 22
THISISMYVERYLONGNAME               A          1 18
THISISMYVERYLONGNAME               E          2 10,20
THISISMYVERYLONGNAME               G          1 16
THISISMYVERYLONGNAME               H          1 2
THISISMYVERYLONGNAME               I          2 3,5
THISISMYVERYLONGNAME               L          1 13
THISISMYVERYLONGNAME               M          2 7,19
THISISMYVERYLONGNAME               N          2 15,17
THISISMYVERYLONGNAME               O          1 14
THISISMYVERYLONGNAME               R          1 11
THISISMYVERYLONGNAME               S          2 4,6
THISISMYVERYLONGNAME               T          1 1
THISISMYVERYLONGNAME               V          1 9
THISISMYVERYLONGNAME               Y          2 8,12
39 rows selected.Which details each individual character of the string, indicating a count of how many times that character appears in the string, and lists all the positions of that character in the string.

Similar Messages

  • How to Count number of words in a file....

    Hi Experts,
    I have uploaded the text file, from the application server, like this: 
    call function 'GUI_UPLOAD'
      exporting
        filename = LV_ip_FILENAME
      tables
        data_tab = LT_FILETABLE.
    The text file contains some number character words....  like "sap labs india..... "
    Now, I wanted to count number of words in an internal table  LT_FILETABLE....  can anybody help me?

    Hi,
    Special Characters in Regular Expressions
    The following tables summarize the special characters in regular expressions:
    Escape character
    Special character Meaning
    Escape character for special characters
    Special character for single character strings
    Special character Meaning
    . Placeholder for any single character
    C Placeholder for any single character
    d Placeholder for any single digit
    D Placeholder for any character other than a digit
    l Placeholder for any lower-case letter
    L Placeholder for any character other than a lower-case letter
    s Placeholder for a blank character
    S Placeholder for any character other than a blank character
    u Placeholder for any upper-case letter
    U Placeholder for any character other than an upper-case letter
    w Placeholder for any alphanumeric character including _
    W Placeholder for any non-alphanumeric character except for _
    [ ] Definition of a value set for single characters
    [^ ] Negation of a value set for single characters
    [ - ] Definition of a range in a value set for single characters
    [ [:alnum:] ] Description of all alphanumeric characters in a value set
    [ [:alpha:] ] Description of all letters in a value set
    [ [:blank:] ] Description for blank characters and horizontal tabulators in a value set
    [ [:cntrl:] ] Description of all control characters in a value set
    [ [:digit:] ] Description of all digits in a value set
    [ [:graph:] ] Description of all graphic special characters in a value set
    [ [:lower:] ] Description of all lower-case letters in a value set
    [ [:print:] ] Description of all displayable characters in a value set
    [ [:punct:] ] Description of all punctuation characters in a value set
    [ [:space:] ] Description of all blank characters, tabulators, and carriage feeds in a value set
    [ [:unicode:] ] Description of all Unicode characters in a value set with a code larger than 255
    [ [:upper:] ] Description of all upper-case letters in a value set
    [ [:word:] ] Description of all alphanumeric characters in a value set, including _
    [ [:xdigit:] ] Description of all hexadecimal digits in a value set
    a f
          v Diverse platform-specific control characters
    [..] Reserved for later enhancements
    [==] Reserved for later enhancements
    u2192 More
    Special characters for character string patterns
    Special character Meaning
    Concatenation of n single characters
    {n,m} Concatenation of at least n and a maximum of m single characters
    {n,m}? Reserved for later enhancements
    ? One or no single characters
    Concatenation of any number of single characters including 'no characters'
    *? Reserved for later enhancements
    + Concatenation of any number of single characters excluding 'no characters'
    +? Reserved for later enhancements
    | Linking of two alternative expressions
    ( ) Definition of subgroups with registration
    (?: ) Definition of subgroups without registration
    1, 2, 3 ... Placeholder for the register of subgroups
    Q ... E Definition of a string of literal characters
    (? ... ) Reserved for later enhancements
    for more details please refer the following,
    [http://help.sap.com/abapdocu_70/en/ABENREGEX_SYNTAX_SIGNS.htm]
    [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/902ce392-dfce-2d10-4ba9-b4f777843182?QuickLink=index&overridelayout=true]
    Thanks,
    Renuka S.

  • I want count "space" token in my table field and separate them

    I want count "space" token in my table one field column and separate the word between them.
    word are store in another table.
    possibly give solution in[b] Postgres DB and Oracle DB
    for example
    table name search
    column name is keyword
    keyword
    " chinese colaba" --> spaces are 2
    " chinese borivali (W)" --> spaces are 3
    " deal shoes bandra (E)" --> spaces are 4
    and separate word in new table
    field
    chinese
    colaba
    chinese
    borivali
    (W)
    deal
    shoes
    bandra
    E)
    Message was edited by:
    Rajiv_Birari

    Hi,
    Can you rephrase you Question..!!
    My understanding with your quesiton might be thinking about Partitions or Moving the data to Different tablespace.
    Thanks & Regards,
    Pavan Kumar N

  • Count characters in Word for Mac

    Hi Guys, does sb know how can I count characters in Word for Mac? Pls help me... THX a lot!

    If you select the text you want a count of (or if you want the entire document, you can just leave nothing selected) and then go to the Tools menu and select Word Count you will get a dialog that includes the character count.
    I am using Word 2011, other versions may vary.

  • IOS Cangjie input method can not be used. Original with Space Bar word selection function is invalid, as soon as possible to solve, it will affect the most users in Taiwan and Hong Kong.

    iOS Cangjie input method can not be used. Original with Space Bar word selection function is invalid, as soon as possible to solve, it will affect the most users in Taiwan and Hong Kong.

    No PR1.2 Firmware update, No update for Nokia Messaging, No updates for Ovi Maps .... Why is the N900 the forgotten stepchild ?
    "PR1.2 is still being tested - http://twitter.com/luovanto/statuses/13087245356"
    Hong Kong Launch http://www.youtube.com/watch?v=pY8zCBzvQLo

  • Find space between word with different endings and digit

    Hi,
    I'm trying to figure out how to find spaces between word and digit.
    I am limited to use only word 'WORD' (either capital or small caps) with different endings like -ing -s -y and more (using \S+).
    I wrote something like (?i)(?<=WORD\S+)\s(?=\d+) but this does not seem to work due to some limitation of lookahead I belive?
    Any suggestions?
    Peter

    Peter Stnsz wrote:
    … find what: (\<WORD\S+)(\s)(?=\d)
    change to: $1~s
    Hmmh?
    Your Grep do not find your first example: WORD 0,2 (WORD without any ending)
    And you don't need the second ()
    And please do not use \S
    Use this instead:
    (\<WORD\l*)\s(?=\d)
    (l is the little L)
    Have fun

  • Sapscript - Repited spaces between words

    Hi friends.
    I'm working on a ZMEDRUCK sapscript and when printing a line item, the item text (field EKPO-TXZ01) is being printed with spaces between words.
    E.g.:
    Original value in EKPO-TXZ01: material test.
    Printed: material      ...(two or more spaces)...       test.
    This also happened with other text variable, but stopped happen when I formated with <K> text </>.
    But in this case, its not working. I'm using standard IT Paragraph format.
    What to do to take out the repited spaces ?
    Edited by: Glauco Kubrusly on Mar 24, 2011 5:02 PM
    Edited by: Glauco Kubrusly on Mar 25, 2011 4:27 PM

    Hi Atul.
    I have already tested (C) statement in this variable and performs too.
    There are more texts with same problem. Literal words have same problem too in address in the header.
    I've already tryied copting standards paragraphs too, but without sucess.
    A friend concultant said to me to make a test with a new paragraph with LEFT alignment only and LEFT alignment to all tabulators. I'll try that once and give feedback here.
    Any other idea ?
    thanks.
    Glauco
    Edited by: Glauco Kubrusly on Mar 27, 2011 10:16 PM

  • Office 2010 spaces between words not consistent

    Hello all,
    I recently switched from Office 2003 to Office 2010. Since the switch I notice that the spaces between words are not consistent in length.
    I selected the spaces individually and even in the selection you see differences in the size of the spaces.
    This example is from a PPT using Ariel, 18 font size.
    Things I've tried so far:
    I've tried disabling kerning, but that makes the font look really bad. I also tried adjusting the character spacing and while this does solve the issue on an individual basis, I don't have the time to go over every space in a document or presentation to fix
    this issue. 
    The text is aligned left and I've verified that there is only one space between the words.
    I tried the same document on 2 different pc's. One of Windows 7, the other on Windows 8.1. Both have this issue with Office 2010. 2 Different computers using Office 2013 do not have this spacing issue.
    Does anyone know if this is a known issue with Office 2010? Is there a fix?
    Thanks in advance,
    Zjef

    Hi Zjef,
    Generally, in Word, spaces should be consistent for all texts, unless you have your paragraph set to "Justify" which means to stretch out the text to fill the entire space within the margin.
    So please first check if you have this option selected for your text.
    Also, have you ever tried to print it out and check if it's the same as on the screen? Sometime word will adjust the space to improve document readability, which vary by screen sizes, video cards, etc.
    Regards,
    Ethan Hua
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • How can i write with double spaces between words ?

    hello everyone,
    i need to write in pages with double spaces between words not between lines ..
    how can i do it and make it default ?
    for now, just write and click space bar twice ..!!!

    Do you really need to do this? It is so ugly and illegible.
    You can use a monospace font or use the auto-complete in Menu > Pages > Preferences to auto-substitute 2 spaces for each one.
    Peter

  • After installing lion and updating to pages 4.1 cannot view my document content after I open the document.  Shows how many pages I have and how many words in word count, but no words...

    after installing lion and updating to pages 4.1 cannot view my document content after I open the document.  Shows how many pages I have and how many words in word count, but no words...

    Same problem. Tried reinstalling Pages. Didn't help. The behavior is like I am typing with a white font on a white background, but I am not.

  • TextEdit Applescript help counter of certain words

    I have tried to modify a script that finds and replaces text. My goal is to count the instances the script finds a word, say "love", and spit out the number of instances that the word "love" appears in the document so I can use it for another subroutine. Any help is appreciated.
    I have this as guideline but it seems it does not work.
    tell application "TextEdit"
    set myCountSign to text of document 1
    set myCount to count myCountSign
    repeat with this_word in myCountSign
    if (this_word as string) is "love" then
    set myCount to myCount + 1
    end if
    end repeat
    myCount
    end tell

    The most obvious problem with your script is the line:
    repeat with this_word in myCountSign
    This looks at myCountSign (a block of text) and iterates through it assigning each text object to this_word.
    The problem is that by default each 'text object' is each character therefore you're comparing each character in the text to the string 'love' which will never, ever match. Even if the word exists you'd be performing a character-by-character comparison.
    The simplest fix is to tell AppleScript to look at the words in the text, which is done simply by:
    repeat with this_word in (words of myCountSign)
    (note you might also need to do this for 'set myCount to count myCountSign' since this will return the character count, not the word count)
    There are other, more efficient ways (such as via text item delimiters):
    tell application "TextEdit"
      set myCountSign to text of document 1
      set wordCount to (count words of myCountSign)
      set {oldtids, my text item delimiters} to {my text item delimiters, "love"}
      log set keywordCount to (count text items of myCountSign) -1
      set my text item delimiters to oldtids
      display dialog "The document has " & wordCount & " words and " & keywordCount & " occurrences of the word 'love'"
    end tell
    The text item delimiters approach works by breaking the text into chunks at each occurrence of the delimiter (in this case, the string 'love'). Then all you have to do is count the number of chunks (minus 1) which is a lot quicker than counting all the words, especially for large documents.

  • Character wise count of a word

    Hi
    I want a query to find to find the character wise count of a word.
    Ex..if the word is Marium Thomas
    I just want to get the output as---
    M ------- 2
    A -------- 2
    PLease help me to solve this out.

    Hi,
    Hope this helps for you.
    declare
    a varchar2(1000):='ABBCCCDDDDEEEEE';
    b number;
    c varchar2(100);
    d varchar2(100);
    l number:=1;
    k number:=1;
    count1 NUMBER:=0;
    begin
    select length(a) into b from dual;
    for z in 1..b loop
    dbms_output.put_line('--------------------------------');
    c:= substr(a,l,1);
    if c IS NOT NUll then
         count1 := 0;
    k :=1;
         for j in 1..b loop
         d:= substr(a,k,1);
         if d IS NOT NULL THEN
    if(c=d) then
    count1 := count1+1;
    End if;
    ELSE
    k :=0;
         END IF;
         k :=k+1;
         end loop;
    ELSE
    l :=0;
    END IF;
    l := l+1;
    dbms_output.put_line('Character : '||c||' count : '||count1);
    dbms_output.put_line('--------------------------------');
    end loop;
    end;
    Thanks,
    Vinoth

  • Regular expression to replace "emtpy space" ( ) bitween words with +

    Hallo!
    When I wish to find in code something like this:
    12144541 FirstWord SecondWord
    regular expression for that is:
    (\d{1,100})[\s-]\D{1,100}[\s-]\D{1,100}
    Now, please help me tu find regular expression to replace
    "emtpy space" ( ) bitween words with +
    12144541 FirstWord SecondWord to become
    12144541+FirstWord+SecondWord
    Thank you very, very, very much!

    A simple-minded solution is to use \s to match all
    whitespace; e.g. find \s and replace with +. DW CS3, at least, is
    smart enough to not replace end of line characters with the '+'
    character if you limit your search & replace to text.

  • Why is illustrator CS6 omitting the spaces between words?

    Out of the blue, my type tool has been acting funny in Illustrator CS6. Generally my text boxes or bounding boxes are outlined in blue. However, now they are black. I'm not sure what instigated the change. Now I am typing in illustrator and it won't show any spaces between words. Everythinglookslikethis. In the character pannel, the kerning is set to auto and tracking is set to 0. Does anyone know what is going on? What are these black text boxes of death?

    chatterville wrote:
    Out of the blue, my type tool has been acting funny in Illustrator CS6. Generally my text boxes or bounding boxes are outlined in blue. However, now they are black. I'm not sure what instigated the change.
    Creating a new layer changes its selection color. Look in the Layer's panel and double click the layer to change its color.
    .. Now I am typing in illustrator and it won't show any spaces between words. Everythinglookslikethis. In the character pannel, the kerning is set to auto and tracking is set to 0. Does anyone know what is going on? What are these black text boxes of death?
    Not sure but, try changing the font.
    You can also try the word spacing options in Justification from the flyout menu of the Paragraph panel

  • When I copy/paste a paragraph from a PDF doc, it pastes with no spaces between words. How can I fix this? I've searched everywhere for the solution but didn't find anyone had this issue.

    When I copy/paste a paragraph from a PDF doc (onto Facebook status bar, for example) it pastes with no spaces between words.  I.e: "The manhadajugofcoolwaterand offeredmeadrink." How can I fix this? I've searched everywhere for the solution but didn't find anyone had this issue. I'm new to Apple so any help will be much appreciated. Thanks!

    I can't speak about this occurring with FaceBook since I don't use FaceBook, but I see the same type of thing when I copy and pasted from websites. It doesn't always happen and I cannot find any particular set of circumstances under which it occurs or does not occur.
    I am merely responding to let you know that it happens to me as well and I have seen no way to correct it. I'm not so sure that there is a way to correct in in that it may have something to do with how the original text is formatted in the PDF or on the website and how it eventually "fits" into the text field or the area in which it is pasted.

Maybe you are looking for

  • IPod Nano + USB Power Adapter (+ Universal Dock)

    Hi, I've got an iPod Nano and a USB Power Adapter to charge it. Untill a few days ago it went fine, even with my Universal Dock between them. But since 2 days my iPod only charges when I put the Power adapter direcly into the wall plug, but with my H

  • [svn] 2142: swfutils: Somehow a Java 1.5 API (Integer.valueOf(int)) slipped into the 30x branch, and has only sporadically caused build problems.

    Revision: 2142 Author: [email protected] Date: 2008-06-18 15:17:01 -0700 (Wed, 18 Jun 2008) Log Message: swfutils: Somehow a Java 1.5 API (Integer.valueOf(int)) slipped into the 30x branch, and has only sporadically caused build problems. * By "someh

  • Nokia 1020 lumia camera issue (and flashlight X)

    Hello! I do not know this absolutely but I noticed after I downloaded a couple of updates, including an update to Flashlight X, on my nokia 1020 that it suddenly started taking pictures on its own back to back with out stopping. The phone also got wa

  • Cannot burn DVD...

    Hi, for the last several weeks, my iMac G5 (iSight) does not burn DVDs. I did a little research and found iMac is very picky with DVD media. Recently I quit using Toast and changed to us Finder to burn DVD. Then an error code 536870198 appeared and c

  • DISTINCT in the query -- RBO vs CBO

    Hi all, We are in a process of migrating our applications from RBO to CBO as we moved to 10g and recently I observed a simple query with DISTINCT clause showing different results in CBO. Here is my order of creating a table in 10g environment, create