To get Length of each word in a String.

Hi,
I wanted to know, how to calculate the length of each word in a string.Suppose for example if the input is like this:
i/p:'Tech on the Net'
o/p:4 2 3 3
ie Tech-4 on-2 the-3 Net-3
another Ex:i am a good boy
o/p:1 2 1 4 3
Kindly let me know any PL/SQL function or SQL query which would help to achieve this.
Thanks&Regards
Zaheer

sql>select substr('tech on the net',decode(n,0,1,instr('tech on the net',' ',1,n)+1),
              decode(instr('tech on the net',' ',1,n+1),0,length('tech on the net')-instr('tech on the net',' ',1,n),
                    instr('tech on the net',' ',1,n+1)- decode(n,0,0,instr('tech on the net',' ',1,n))-1)) wrd,
      length(substr('tech on the net',decode(n,0,1,instr('tech on the net',' ',1,n)+1),
              decode(instr('tech on the net',' ',1,n+1),0,length('tech on the net')-instr('tech on the net',' ',1,n),
                    instr('tech on the net',' ',1,n+1)- decode(n,0,0,instr('tech on the net',' ',1,n))-1))) cnt
from(select rownum-1 n
     from dual
     connect by level <= length('tech on the net') - length(replace('tech on the net',' ',''))+1)
WRD CNT
tech  4 
on  2 
the  3 
net  3                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Display each words of the string in separate line.

    Dear Javaties,
    pls help me creating this program.
    Display each words of the string in separate line.
    Eg.
    Input value : Testing this string.
    Output : Testing
    this
    string
    Thanks in adavance,
    M. Suresh

    M Suresh,
    We would be delighted to help if only you asked a specific question. Do my work for me is not a specific question.
    The Javaties

  • Name of Filename getting padded with + after each word while saving it

    Hi all,
    We are upgrading from EP6 SP16 to EP7 SP10.
    In one of our application we have a link on click of which an XML is generated while saving that XML the name for that XML file name is getting padded with <b></b> after each word like <b>XMLformat001.xml</b> and that XML is getting saved as <b>XMLfor+mat001.xml.</b> instead of XMLformat001.xml.
    Please help us out
    Thanxs in advance

    Hi,
    From language was English. To language was Spanish.
    While copying to language text, I had left blank spaces after every Spanish word. The blank space was becoming \r\n while getting displayed in portal.
    The issue got sorted out once I removed blank spaces after Spanish word.
    Thanks
    Edited by: Stuart on Feb 5, 2008 3:45 PM

  • How to read each and every word from a string.

    Hi all,
       I have a string which is having many label numbers. if the string is lv_str, its value is like, 11111111111111##22222222222222##3333333333333.
    I need to move the values alone into internal table. each value should be updated as a single row into one internal table. How to read each and every word of the string and move to an internal table.
    the internal table should be like this.
    11111111111111
    22222222222222
    3333333333333
    Can any one give me a suggestion in this regard.
    POINTS PROMISED.
    Regards,
    Buvana

    Hi,
    If you know the format and length of the data
    Use split at '#' so that you will get the individual values.
    Thean append it to internal table.
    Reward iof helpful.

  • How do i get rid of the word 'site' in the my website address

    Hello,
    My website is www.giftedconsultants.com, done in iweb, hosted by little oak. After I publish and then go to the site, each page comes us like this-www.giftedconsultants.com/site/Home.html. My question is how do I get rid of the word 'site'? When I try to leave it blank in iweb, it forces me to put something in that box. Help!
    Thanks,
    Eleanor

    It's often Q&A'ed in this forum. Here's the reply you will find when you search for it :
    To learn about the concept of Sites in iWeb and how to avoid the iWeb Sitename in the URL, read my blogs :
    [The concept of iWeb Sites|http://iweb.dailynews.webege.com/Howto_publish_to_a_subdomain_withiWeb.html]
    [Avoiding the iWeb Sitename in the URL|http://www.wyodor.net/blog/archives/2010/01/entry_299.html] (non MobileMe)
    [Publish to MobileMe without the Sitename in the URL|http://www.wyodor.net/blog/archives/2010/03/entry_309.html]
    For your convenience a beautifully illustrated pdf also explains it : [The concept of iWeb Sites|http://homepage.mac.com/wyodor/.Public/The concept of iWeb Sites.pdf]
    And Google knows it too : [iweb remove site name|http://www.google.com/search?q=iwebAND+remove+AND+site+ANDname]

  • Getting sum of each column in 2D array

    hi,
    i want to get sum of each column from 2D array. i did public static void main(String[] args) {
              double sum=0.0;
                   int[][] arr={
                             {1,2,8},
                             {2,2,3},
                             {2,2,5},
                             {1,2,8},
                             {1,1,9},
                             {2,2}
                   int i=0,j=0;
                   int len=arr.length;
                   while(j!=len){
                        sum=0;
                        for(i=0;i<arr.length;i++){
                        sum+=arr[i][j];
                        System.out.println("sum is:" +sum);
                        j++;
         }but it doesnot work for jagged array...somebody please help!
    thankx                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Stop assuming the rows in your matrix are all the same length. Arrays know how long they are. Use that information to determine if the current column exists in that row.

  • Text input - how set an automated space after each word?

    When typing in text and using the qwerty assisted text - how can i get it to automatically add a space after each word? My Droid original did that automatically... Thanks

    lovetennis7 wrote:
    When typing in text and using the qwerty assisted text - how can i get it to automatically add a space after each word? My Droid original did that automatically... Thanks
    I have confirmed that this feature was not included with the basic software package of the Incredible 2. 

  • How to get IAttributeStrand for each Cell in Table

    Hello All,
    I am trying to set the font and size depending upon the user inputs under each cell in the table.
    For Text frame I am able to achieve this by using ITextModel->QueryStrand(). But for Table I am not able to find any function which can allow me to query the Cell Strand and allow to apply the attributes.
    Has anyone been able to achieve the same. If so please do let me know its urgent.
    Thank you all in advance.
    regards
    Farzana.

    Hi,<br /> <br />Thanks for the prompt reply. By the way I forgot to mention that we are using the same in CS3.<br />We tried as you have mentioned in your mail. But we did not find any way to achieve the ITextStoryThread from ICellConent. We tried all possible ways but we always get the Text Frame TextModel.<br />We have used following code to get TextModel for each cell. We get correct startindex and endindex for each cell and also get the valid TextModel Interface. But when we try to find out its length then it returns the whole TextModel length. <br />Thus when we try to apply different attributes for each cell then it applies to whole table. <br />E.g. When we try to apply 12 font size for 1st cell then it also applies to remaining cells.  So we think we are not able to find out correct TextModel for each cell. <br /> <br />Below is our snippet of code on what we tried.<br /> <br />ITableModel::const_iterator iterTable(tableModel->begin());<br />ITableModel::const_iterator end(tableModel->end());<br /> <br />while(iterTable != end) <br />{<br />GridAddress gridAddress = *iterTable; <br />GridID gridid= tableModel->GetGridID(gridAddress);<br /> <br />   InterfacePtr<ITableTextContainer> tableTextContainer(tableModel, UseDefaultIID());<br />   if(tableTextContainer != nil) <br />   {<br />       InterfacePtr<ITextModel> textModel(tableTextContainer->QueryTextModel());<br />       if(textModel != nil) <br />       {<br />          InterfacePtr<ITextStoryThreadDict> textStoryThreadDict(tableModel, UseDefaultIID());<br />          if (textStoryThreadDict != nil) <br />          {<br />              InterfacePtr<ITextStoryThread> textStoryThread(textStoryThreadDict->QueryThread(gridid));<br />              if (textStoryThread != nil)<br />              {<br />                 InterfacePtr<ITextModel> iTextModel(textStoryThread->QueryTextModel());<br />                 if (iTextModel != nil)<br />                 {<br />                      TextIndex startIndx;<br />                      TextIndex endIndx;<br />                      startIndx=textStoryThread->GetTextStart(&endIndx);<br />                 }<br />                 else<br />                     CAlert::ErrorAlert("iTextModel == nil");<br />             }<br />          }<br />       } <br />   }<br />                                     <br />   ++iterTable;    <br /> }<br /><br />Regards,<br />Farzana.

  • Getting rid of 3 words at top of page on Safari

    How can I get rid of 3 words at top of page left over from an earlier search on Safari?

    First sorry for the spelling I am dislex..
    If this is at the VERY top then it's sound to me as it's on the links bar. (is it?) if it is then this bar repersents the pages you have in your site as you add and remove pages so this bar changes, when you site is live/publised visiters to you site use this bar to move from page to page (it a menu).
    I would say you have one page called welcome and one call blank. Each page on your website has setting that can be changed using the "Inspector" if you click on the page you want to change and then click on the icon"Inspector" at the botom of iWeb a panell will open up with the setting for the page/object if you make shour the page tab is chosen "page" will apper in the pannel you will see "Page Name" this is where you set the page name(as if you could not gess that one) and 2 tick boxes
    Include page in navigation menu.
    and
    Display navigation menu.
    So on the pages you don't want to appear in the top navigation menu of the pages that have one you click this box
    and on the pages you want to have a navigation menu you click the other or both
    Have a play with them and enjoy
    Steve (I do Not work for Apple)
    P.S. almost all Mac apps I have see have a "Inspector" for objects and it is very powerfull play with it!!!! BUT REMBER WHAT YOU HAVE DONE.

  • Possible to get length from midi files?

    Is it possible to retrieve the length from a midi file, for example in miliseconds?

    And how is that helping me?So my taking my limited free time to consider your question, do a search on google, and pull up a very appropriate article -- all as a volunteer mind you -- is not helpful?
    A word of advice: you will have a much greater chance of getting more help if you show appreciation for anyone who takes the time out to consider your problem and offer any even remotely useful solution.
    just my 2 Shekel's worth...
    It explains how MIDI format is built...
    I am no pro as you may understand, because I posted
    in "New To Java".And I can magically read your mind and know exactly where you are in your java development? Sorry, I left my mind-reading cap at work. You were not exactly detailed in what you were seeking, what you know, and what you've found so far. Another word of advice: try to put as much effort into asking your question as you'd like someone would to answer it.
    And I know you can get length of .wav files for
    example by using Clip. That's why I am asking if
    there's a way for midi files as well. Like a method
    for AudioStream or whichever.I hope you find your method. But this is all the help you are going to get from me. Geeze...

  • Pls help me to count the no of occurence of each word in the data file

    I want to count the no of occurence of each word the data file..
    anybody help me out to solve this ,,
    I have attached my code hereby...
    import java.io.*;
    import java.util.*;
    import java.util.Collections;
    import javax.print.attribute.standard.Media;
    class WordCounter1 {
    String s;
    String word;
    public static void main (String[] args){
         WordCounter1 simpleCounter= new WordCounter1();
    try
    File firstFile=new File("C:/Documents and Settings/janmala/file4.txt");
    simpleCounter.countWords(firstFile);
    catch(Exception e)
    System.err.println(e);
    void countWords(File inputFile)
    int count=0;
    int key=0;
    LinkedHashMap lhm=new LinkedHashMap();
    try{
    FileInputStream fin=new FileInputStream(inputFile);
    DataInputStream din=new DataInputStream(fin);
    while(din.available()!=0){
    s=din.readLine();
    StringTokenizer st=new StringTokenizer(s);
    while(st.hasMoreTokens())
    word=st.nextToken();
    lhm.put(word,count);
    if(lhm.containsKey(word))
    lhm.get(word);
    count++;
    System.out.println(word);
    System.out.println(count);
    int a=lhm.size();
    System.out.println("The size of Hash map"+a);
    Set set = lhm.entrySet();
    Iterator it = set.iterator();
    while(it.hasNext())
    Map.Entry me = (Map.Entry)it.next();
    System.out.println(me.getValue()+":"+me.getKey());
    catch(Exception e)
    System.err.println(e);
    }}

    jan07 wrote:
    anybody help me out to solve this ,,Solve what?
    Don't just dump a pile of unformatted code and expect someone to magically fix it for you.
    Post code, hightlight it and click the CODE button to retain formatting
    Include error messages if you get them
    Ask an actual question

  • HT201210 hi,am trying to restore my ipod but i am getting this message each time:the ipod could not be restored-an unknown error occured,what should i do?

    hi,am trying to restore my ipod but i am getting this message each time:the ipod could not be restored-an unknown error occured,what should i do?

    Was the complete wording of the error message? Usually an error number or other information is also provided

  • Why are there no Clip Lengths on each clip? (CS6)

    Why are there no Clip Lengths on each clip, along with many other choosable clip attributes most all other editing programs offer?  I often need to glance at many clips at the same time and need to see their lengths relative to each other when editing commercials or programs with many many short cuts. precision is impossible without this identifier.

    You are not getting bashed...and especially not because your are a recent arrival here...but you are getting opinions, questions and also an insight into others workflows. Thats what a Forum is for. ( Justwait till you meet Harm M. if you want to get really sensitive and reactive!)
    Many longtime members of this site are well experienced with helping the "recent converts" who come in here and immediately have "issues" because its not "how it was done" in what ever NLE  they converted from. ( Usually FCP)
    Usually the issues are unfounded and if they are... usually it is suggested that a "Feature Request" is made to Adobe ( with a Link).  We users are very well served by Adobe staff in here and often the suggestions are forum debated and taken on board as being worthy.
    Could anyone actually  make Feature Requests to Apple and have them listen? 
    (Obviously not by virtue of history)

  • First character in each word

    Hello All,
    I want to get the first character of each word:
    If I have "Statement To Be Parsed" so i want a query to return STBP.
    Your help please

    Hi,
    NB wrote:
    Hello Franck,
    One more thing i have the below case which is not covered
    "Test STMT Func/ Brg E.O.D Act ON LINE/ Ext" i want it to be TSF/BEAOL/E
    please your help againINITCAP conisders '.' to mark the end of a word, so INITCAP ('E.O.D.') returns 'E.O.D.' (all capital letters). If you want to ignore '.'s, so that you get 'Eod' (only 'E' capitalized) as a result, then use REPLACE (or some other string manipulation function) to get rid of the '.'s before calling INITCAP.
    REGEXP_REPLACE (str, '[^A-Z]') returns a copy of str with all characters except those indicated inside the square brackets removed. If you want other characters (such as '/') kept, then just add them to the list inside the square brackets, like this:
    SELECT     REGEXP_REPLACE ( INITCAP ( REPLACE ( 'Test STMT Func/ Brg E.O.D Act ON LINE/ Ex'
                     , '[^A-Z/]'
                     )     AS inits
    FROM    dual;Output:
    INITS
    TSF/BEAOL/E

  • HELP! On PC reboot all my extensions get disabled and each one opens a new Tab!

    Help!!!
    On PC reboot all my extensions get disabled and each one opens a new Tab!
    I have seen 2 threads here about this issue and a few more by googling the problem.
    However nothing, nothing, noithing... worked!
    Win7, MS Office 2007, Sony Vaio SZ1VP, FF 10.0
    and:
    >
    Download Unlimited 1.0, Read it Later 2.1.4, Pixlr Grabber 2.1.1, Cool Preview 3.5, Telyfi 1.2.5, Speed Dial 0.9.6.4, Google shortcuts 2.1.7.1, Scrapbook 1.4.9, Screen Grab (fix Version) 0.9.6.3c, Vertical Toolbar 0.2.6, Google Translator for Firefox 2.1.0.1, TinEye Reverse Image Search 1.1, Grooveshark Premium, 2.0.2, Quick Maps 1.5.0.
    >
    To try to solve this issue, I:
    Uninstalled:
    Antivirus (BitDefender)
    PC Cleaner (CCCleaner)
    Flash,
    Java,
    Shockwave,
    MediaPlayer...
    FF (deleting all the settings).
    Then reboot twice for safety.
    Then re-installed Java, Flash, Shockwave.
    Reboot once more.
    Re-installed FF, reboot once more.
    Checked that all the plugins were updated, and only then I finally installed my extensions.
    Checked that the user.js and preferences.js were not read only.
    Everything worked fine (even FF restart) until the next OS reboot!
    Then it all strated again!!!!!! It's driving me crazy!!!! Please, help! Machine cannot defeat man... or, better, machine can defeat me, but not the whole of the FF community!!!!!
    Please, I must get to the end of this story! Help!!!
    Tommaso

    NM, got it fixed. Thanks!!!

Maybe you are looking for

  • Trying to run external script using Runtime.exec

    Hey, I am trying to use Runtime.exec(cmd, evnp, dir) to execute a fortran program and get back its output, however it seems to always be hanging. Here is my code snippet :             Process process = Runtime.getRuntime().exec(                   "./

  • ATI 5870 can't play from minidisplay port

    Hi mac pro 12 core, ATI 5870, 12 core - 2,66 ghz, 8 gb ram, sata Tempo e2p card to 2 lacie disks. Bought on sept 2010. In many occasions I cannot use mini displayport of the mac pro with my two hp 24" (they offer different output: displayport, dvi, h

  • Implementing FSCM with EHP5

    Hello, We have upgraded our SAP R/3 system to EHP5 SP4. As per SAP documents we donot need additional XI/PI server for configuring credit management . We have configured Web services reliable messaging (WS-RM) in our system. Then we use the SOA Manag

  • A error in ejb deployment

    i got a error in j2see deployment i deploy a entity bean,but while the Deployment Progress ,i got a error: java.rmi.ServerException:RemoteException occurred in server thread;nested exception is: java.rmi.RemoteException: Error processing ejb jar: Com

  • How do i delete photos from iPhoto without deleting them permanently from my macbook pro?

    I'm sorry but i'm new to all this. When i move photos from iphoto to the trash will that also delete that particular photo from my macbook pro storage entirely?