To extract the last word in a string

Hi
I am using BODS 14.1.1.210 
I would like to extract the last word in a string in BODS query. How can I achieve this when  I don't know how many words are present in a space delimited string.
Example
Input                                              Output    
My name is Tim                              Tim
Complicated                                    Complicated
there is a bird in the nest                 nest
Please let me know if there is a query function for this one.
Cheers!

Hi,
try this-
word_ext(fieldname,-1,' ')
Atun

Similar Messages

  • How to delete the last char in a String?

    i want to delete the last char in a String, but i don't want to convert the String to a StringBuffer or an array, who knows how to do?

    Try it in this way
    String MyString = "ABCDEF";
    MyString = MyString.substring(0,MyString.length()-1);

  • Here's how to find the right word in a string

    I needed to find the rightmost word in a string. I didn't find a simple formula in these forums, but I now have one, so I wanted to share it. Hope you find it useful.
    Assuming that the string is in cell A1, the following will return the rightmost word in the string:
    RIGHT(A1,LEN(A1)-FIND("*",SUBSTITUTE(A1," ","*",LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))

    I found the problem. Whatever character was being used in the substitution was parsed out by the forum parser. I replaced it with "œ" (option q on my keyboard).
    =RIGHT(A1,LEN(A1)-FIND("œ",SUBSTITUTE(A1," ","œ",LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))
    Still needs an error check for a single-word "sentence" and to remove the trailing period but it does seem to work. Pretty slick.
    Message was edited by: Badunit
    I see below that the problem was fixed by the OP.
    Message was edited by: Badunit

  • How can I extract the last 4 numbers of the SSN to be auto-populated in another text box?

    I'm creating a form for my place of business and need to figure out how to extract the last 4 numbers from a Social Security Number formatted text box into another text box that just asks for the last 4 numbers.  Can anyone help me please?

    A very similar thing was discussed recently in this thread: http://forums.adobe.com/thread/1071629?tstart=0

  • How to remove only the last element of spreadsheet string

    I use path to string option to store image path into database and while retrieving the string is again converted into path but it gives out an error as the output of array to spreadsheet string gives out a tab at the end which is unable for the IMAQ read file to recognise.but when i use the path of the image directly into IMAQ readfile the image is opened . so how to remove the tab only at the end of output of the spreadsheet string(whose length can vary)? I have also attached my program with this.
    Attachments:
    retrieve_images_from_DB.vi ‏65 KB
    file_path_to_db_(images).vi ‏40 KB
    create_table_for_images.vi ‏45 KB

    indhu wrote:
    > Thanks for your reply!
    > But my problem is to remove only the last element(which is a tab or an
    > alphabet) from a spreadsheet string of any length.
    If you just want to remove the last character of a string just use the
    String Size function reduce the result by one and wire it together with
    the string to the Split String function.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Sql query to find the last word in a sentence (column)

    Hi,
    I have to retrieve the last word in a column containing varchar2(text) values.
    If anyone knows the query for this kindly share with me.

    There's also the option of regular expressions in 10g onwards...
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select 'oracle forums is the best resource for oracle intelligence' as l from dual)
      2  select regexp_replace(l, '[[:print:]]* ([^ ]*)$','\1') as l
      3* from t
    SQL> /
    L
    intelligence
    SQL>

  • Deleting the last char of a string

    How can I Delete the last char of a string???
    example:
    asd@fdg@vvdfgfd@gdgdfgfd@gdfgdf@
    I want delete the last @!
    Tks in advance!

    hi,
    try this:
    lv_count = strlen(string).
    lv_count_last = lv-count - 1.
    replace string+lv_count_last(lv_count) in string by ' '.
    This should work.
    thnx,
    ags.
    Edited by: Agasti Kale on Jun 4, 2008 9:03 PM

  • RE: Global Object -- the last word

    Chris,
    You are correct. My apologies for not testing my reply sooner. The
    OLM.RegisterObject method does touch the NameService, but OLM caches
    registrations and therefor OLM.BindObject is a local call. So there is one
    network call, but that's all (unless the cache entries are aged out).
    Andrew,
    After testing all of the proposed solutions, using task.part.apptitle seems
    the easiest one to implement. Subclass from TextNullable and add an
    attribute to hold the reference to LocalCache. Remember, TextNullable can
    not be anchored.
    Caveat, you are relying on a Forte feature which may not be guaranteed to
    work the same way in the future.
    At 01:59 PM 10/17/97 -0500, you wrote:
    Where would the network traffic come in? The object location manager
    is local, and if you assume the cache object is also local (there is
    one on each partition), I don't see where the network hit would be.
    Would you please enlighten me?
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Chris Johnson
    BORN Information Services Group
    Forte National Practice
    Direct: 612-404-4409
    Fax: 612-404-4441
    http://www.born.com
    mailto:[email protected]
    From: David Vydra[SMTP:[email protected]]
    Sent: Friday, October 17, 1997 12:42 PM
    To: [email protected]
    Subject: RE: Global Object
    Guy,
    At 11:35 AM 10/17/97 -0500, you wrote:
    Another approach would be to use the partition's object locationmanager
    (task.part.objectLocationMgr) to register the partition's local cachecontainer object (LOCache) under a name based on the
    partition's name. Tasks needing the cache container can use the"bindObject" method to get the reference back.
    I believe this would generate network traffic for each bind, and if
    the
    objects in need of the local service are transient the overhead may be
    considerable.
    ========================================
    David Vydra
    Education Consultant
    Forte Software, Inc.
    [email protected]; phone: (510)986.3593

    Possible problems with using task.part.appTitle.
    1) Isn't appTitle part of the task? If it is, what happens when the
    task goes across a partition boundary? Does the appTitle get serialized
    and deserialized by Forte? As long as the cache itself is anchored this
    reference held in the appTitle is only a proxy. (But a TextNullable
    cannot be anchored.) If the cache is not anchored, won't the entire
    cache get serialized and deserialized at each partition boundary?
    2) If the appTitle goes with the Task when it crosses a partition
    boundary, what happens when some piece of code in the other partition
    attempts to use the cache? If the cache was able to be anchored,
    wouldn't there a network hit at this point? Also, haven't you just lost
    the 'local'ness of the local cache.
    3) What about serialization problems when you enter a partition that
    does not know about the cache object. Won't you get a deserialization
    error when you enter a non-application partition such as the Node
    Manager or Forte's run-time compiler?
    4) Version 3 provides appContext which can be used to hold any Object.
    This should probably only be used for very small objects or anchored
    object that are used infrequently on a different partition. Since
    appTitle cannot be anchored, why would you use it rather than
    appContext (Version 2 is a different story)? AppContext appears to be a
    more generic solution to the global object problem, one that Forte will
    support. Neither AppContext nor appTitle appear to be solutions to a
    local cache problem.
    John G. Bielejeski
    Born Information Services Group (http://www.born.com)
    Forte National Practice
    Voice: (612) 404-4116
    Fax: (612) 404-4440
    mailto:[email protected]
    From: David Vydra[SMTP:[email protected]]
    Sent: Sunday, October 19, 1997 7:04 PM
    To: [email protected]
    Subject: RE: Global Object -- the last word
    Chris,
    You are correct. My apologies for not testing my reply sooner. The
    OLM.RegisterObject method does touch the NameService, but OLM caches
    registrations and therefor OLM.BindObject is a local call. So there is
    one
    network call, but that's all (unless the cache entries are aged out).
    Andrew,
    After testing all of the proposed solutions, using task.part.apptitle
    seems
    the easiest one to implement. Subclass from TextNullable and add an
    attribute to hold the reference to LocalCache. Remember, TextNullable
    can
    not be anchored.
    Caveat, you are relying on a Forte feature which may not be guaranteed
    to
    work the same way in the future.
    At 01:59 PM 10/17/97 -0500, you wrote:
    Where would the network traffic come in? The object locationmanager
    is local, and if you assume the cache object is also local (thereis
    one on each partition), I don't see where the network hit would be.
    Would you please enlighten me?
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Chris Johnson
    BORN Information Services Group
    Forte National Practice
    Direct: 612-404-4409
    Fax: 612-404-4441
    http://www.born.com
    mailto:[email protected]
    From: David Vydra[SMTP:[email protected]]
    Sent: Friday, October 17, 1997 12:42 PM
    To: [email protected]
    Subject: RE: Global Object
    Guy,
    At 11:35 AM 10/17/97 -0500, you wrote:
    Another approach would be to use the partition's object locationmanager
    (task.part.objectLocationMgr) to register the partition's local
    cache
    container object (LOCache) under a name based on the
    partition's name. Tasks needing the cache container can use the"bindObject" method to get the reference back.
    I believe this would generate network traffic for each bind, and if
    the
    objects in need of the local service are transient the overhead maybe
    considerable.
    ========================================
    David Vydra
    Education Consultant
    Forte Software, Inc.
    [email protected]; phone: (510)986.3593

  • Even more about deleting the first word in a string

    hi, i have this code that removes the first word in a string, returns the shorter string, removes the first word from the shorter string aso... what i would like it to do is to stop when it hits a non-character, but i can't get it to do that. does anyone know why \b won't work?
    import java.io.*;
    class Testar {
    public static void main(String[] args) {
          String partDesc = "Hi my name is SandraPandra.";
          while (partDesc.equals("\b") == false) {  //this is where something goes wrong
              System.out.println(partDesc);
              partDesc = partDesc.replaceFirst("^(\\w+)\\s+","");
    } thanx in advance!

      while (partDesc.equals("\b") == false) That compares partDesc to a string consisting of one backspace character. I suspect you're trying to use the regex word-boundary anchor, but that's a dead end. If you want to stop beheading the string when the regex stops matching, you can write the code exactly that way: class Testar {
      public static void main(String[] args) {
        String partDesc = "Hi my name is SandraPandra.";
        while ( partDesc.matches("^(\\w+)\\s+.*") ) {
          partDesc = partDesc.replaceFirst("^(\\w+)\\s+","");
          System.out.println(partDesc);
    } If performance is a concern, you can use a pre-compiled Pattern object for greater efficiency. Thanks to Matcher's lookingAt() method, you can use the same regex for the test and the replacement: class Testar {
      public static void main(String[] args) {
        String partDesc = "Hi my name is SandraPandra.";
        Pattern p = Pattern p = Pattern.compile("^(\\w+)\\s+");
        Matcher m = p.matcher(partDesc);
        while ( m.lookingAt() ) {
          partDesc = m.replaceFirst("");
          System.out.println(partDesc);
          m.reset(partDesc);
    } The ^ anchor isn't really necessary in this version, since lookingAt() implicitly anchors the match to the beginning of the string, but you might as well leave it in.

  • How we can find the last character in a string(Urgent Plz!)

    Gurus!
    How we can find the last character in a string.
    e.g i have a string say "Str" with value "10-01".
    Now i want to find the last character in "Str" i.e "ONE=1".
    i am using Oracle developer 6i with Oracle 8i(1.7).
    Plz help!
    Many thanks!

    Use the substr() and length() functions -
    x := '10-01';
    y := substr(x, length(x));

  • Looking for the last item in a string set in a particular character style

    I should find each space that is the last character in a string set in a particular character style. For example, in the passage "123 456 789" (the underlined part here indicating a passage set in a particular character style), my ideal GREP search would yield a match after the digit 6.
    How do this?

    Excellent! This works perfectly. I have used your string with the bold character formatting, and replaced the matches with [nothing], set in None style.
    On second thought, I was surprised that it indeed had worked: why was the space replaced, and not deleted? Shouldn't I have used
    (?<!.)(\s)(?=\w)
    and replaced it with
    $2

  • The last word always shifts to the next line when published?

    When I layout the page in iweb08 it looks great, when I publish it the last word in a sentence (no matter how short the sentence) is on a separate line. I have tried everything to change this but no luck.
    http://www.thestraydogsrock.com is the website. The bottom blue area where it says "August 16, 2009......." is the problem line. This is a standard iweb template.

    don21480 wrote:
    When I layout the page in iweb08 it looks great, when I publish it the last word in a sentence (no matter how short the sentence) is on a separate line. I have tried everything to change this but no luck.
    What I can think of is pretty obvious so you've probably already tried it.
    In case you haven't: just make the text box bigger. Slide the right side more to the right.
    Or is there a ghost image knocking into it somehow?
    http://www.thestraydogsrock.com is the website.
    The site looks great!
    Wondering myself - how did you do those audio play things, with the horseshoes in them?

  • Testing the last character of a string using .endsWith

    Hi,
    I want to check to see if the last character of a string is '@'.
    I tried if (StringAt.endsWith("a")) {
    but got no results.
    Is this the correct way to do it or is there another way.
    Thanks.
    Adam

    javadocs:
    String's endsWith method takes a string argument.
    endsWith
         public boolean endsWith(String suffix)
              Tests if this string ends with the specified suffix.
              Parameters:
                   suffix - the suffix.
              Returns:
                   true if the character sequence represented by the argument is a suffix of the character sequence
                   represented by this object; false otherwise. Note that the result will be true if the argument is the
                   empty string or is equal to this String object as determined by the equals(Object) method.
              Throws:
                   NullPointerException - if suffix is null.

  • The last character of a string

    How to judge the last char of a string is " ?
    if (s.endsWith("""))or
    if (s.endsWith("/""))

    bet
    you just copied and pasted what the OP had written
    and quickly put that
    backslash in, hit post without previewing first just
    to make me look like
    a slow old sod! It's not fair ;-)
    kind regards,
    JosNope, I used the Alt-[numeric code] combinations to manually type each character. Cut-n-paste is for wimps, and actually typing single-stroke keys is for milquetoasts.
    Alt-[numeric code] is for real men ;-)

  • How can I keep the last word without devision?

    Hallo! By applying page brake if it is a word at the end which has a syllable division the division line disappears so that I have an orthographic error: e.g. if the last word is "marketing" and is being devided:
    Before: End of current page: marke-
    Start of next page: ting.
    After applying page brake:
    End of current page: marke
    Start of next page: ting.
    How can I keep the last word without devision?

    In the Hyphenation Options dialog, uncheck the option "Hyphenate across
    columns"

Maybe you are looking for

  • Font Display Quality Bad After Update

    Hello all, my font display is really bad since upgrading to Tiger. I have Font Smoothing Style set to automatic and have tried light and others but everything appears over-sharpened. For example, as I type this, the font has an extereme sharpening, s

  • If I want to reset my MacBook, would I have to buy all the updates again?

    I want to reset my whole MacBook Pro. 1. If I put my applications to a external hard drive will I be able to use them one I reset them? 2. Will I have to rebuy anything I bought on iTunes/Mac

  • GP: Replacements (parameter) in email templates

    Hi, I have created an email template to send a notification. Into this email I want to add several parameters (which should be done via replacement ?). But neither from the documenation nor by trying I can get these replacements show up. Right now my

  • Determining Partner in Lead transaction thru Organisation  model

    Hello, I need to determine responsible employee in lead transaction thru Organisation model that I have created . Now I dont want to use the attributes of the organisation as we have some constraints in that I need to determine a partner out of the a

  • How to use collection in my code

    PROCEDURE irp_status_check_list(P_YEAR IN VARCHAR2,P_SEASON IN VARCHAR2)  AS g_count NUMBER; BEGIN        FOR CUR_GID IN (SELECT GENERATION_ID                        FROM VRESS_GEN_DDLB_VW                        WHERE SEASON_YEAR=P_YEAR AND SEASON_CO