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

Similar Messages

  • How to find the right primary key for DSO from Business Content

    According to best practice design, it is reccomended to make a  DSO where all fields from Business COntent Datasources are transferred.
    But, how to find the right primary indeks ?
    Any good suggestions ?
    For many of the Business Content dataflows there are not DSOs present, so ther e is no tip to get from the dokumentations as gfar as I have found.
    best Regards
    Ingrid

    Hi Ingrid,
    Your question will be perfect in case if you are going for a Custom cube.
    You will not have any problem when you create a Datasource in R/3 level even if it is been built on a single table or on view.
    Only point that you want to know how to design my Key fields in ODS.
    This will be purely depends at what level that you want to bring the data.
    Egg:-
    If you run the data source in RSA3 and check for Each GL if you have 10 liine items and you want all the 10 line items to be transfered to BW.
    In this case you need to check what is the unique combination of fields that is making this lineitems to exists as 10.then include all those fields into Your ODS Key Fields.
    This way you can have 10 records for that perticular GL in both sides, by which u will make sure that the data is been completely transfered.
    If in case if you clude your own Key fields then you will get the correct Total in report for each GL but you can't see all those 10 line items.
    For any case you need to figureout how many records that you want to take into BW based on that check the fields that makes it unique and then add them to ODS Keyfields that will solve your requirement.
    I think this will clear your doubt.
    Best Regards,
    VNK.

  • How To Find The Right Server........

    Hi Friend�s I am Again Here
    I Have A Question. I have Tool That�s Work is To Check The Duplicate CDR from Three day�s dump and Then Load this CDR�s in Database. I runt his tool on 2.4 GHz System with 1GB ram and I got the result
    74 CDR�s /see Processing.
    This time I Have A problem that I need server to run this tool and I am not getting that how I calculate the right server so that I can get the result upto 500 CDR�s/see
    How Much CPU I need and How Much Ram I Needed. As per My Knowledge this can run fine on 2*2.4 GHz dual core CPU with 8GB ram.
    Is it Fine,,,,,,,,,,,,,,,,,,,
    Can anyone Help to Find Right System for this tool.

    Your post is hard/annoying to read. In English only the start of a sentence is capitalized. There is no need to capitalize every word within a sentence, unless required otherwise, like the pronoun "I" or the person/product names, e.g. "John Doe" and "Java".
    Apart from that, your question has nothing to do with Java at all. Look for a CDR software forum or so.

  • How to find the right kstat info & interpret it ?

    Having found out how to read the kstat structures I am
    still struggling with finding the right information which
    makes sense!
    I am interested in the following statistics:
    0. Swap Space - similar to that reported by swap
    1. Scan rate similar to that reported by vmstat
    2. Handspread page (see Adrian Cockcrofts' performance monitoring articles)
    3. Disk Space Usage - similar to df -k
    4. Process memory usage -- ps
    5. System Error Messages -- this may not be possible to read at all
    from kstat. Probably here I will have to make do with reading /var/adm/messages
    6. Disk Errors -- similar to iostat -E (Solaris 2.6 onwards)
    7. Ethernet stats -- like netstat -I le0
    I found the following article on SunSolve Online: FAQ 1230 'Three Virtual Memory Performance Monitors' which directs me to some of the kstat cell
    types.
    I started with swap space. The above article plus a few other pointers seemed to indicate the the
    correct kstat struct and field to use here was vminfo.swap_avail
    When I compared the figures dumped from this structure with those reported by vmstat & swap they
    did not compare! eg.
    kstat: vminfo.swap_avail 321393372929
    kstat: vminfo.swap_free 33339822544
    vmstat unix tool:
    swap avail (KB) 19932
    Furthermore sysinfo.h indicates that vminfo.swap_avail is expressed in pages.
    1 page = 4.096 KB, so the kstat figures should be multiplied by 4 which makes
    the comparison even worse. Whilst I don't expect the figures to be
    an exact match -- I was hoping they would be in the same ball-park,
    Next I tried page in/page out rate
    Here I compared:
    kstat: cpu_vminfo.pgpgin 473224
    kstat: cpu_vminfo.pgpgout 14554
    vmstat unix tool:
    pi (page in) 4
    po (page out) 0
    These figures sort of match up, if you take the most sig digit in
    vminfo.
    I was wondering if anyone has a definitive list on what are the best
    kstat fields to use -- and if any wierd and wonderful calculations must
    be performed on any of them to get figures close to that supplied by
    the familiar unix tools.

    Hi!
    I wrote a quick program to read the vminfo stats and like you saw completely crazy figures. I looked further into this and found that every second, the system clock routine adds the freemem, swap and so on to a cumulative total.
    To put it another way, the figure you see for free memory is the sum total of the value of freemem sampled every second since your system booted.
    Thus, to get the average freemem in pages since boot, you need to read the value of freemem and divide by the number of seconds since boot.
    You can derive the number of seconds in two ways from the kstats:
    (1) read lbolt (incremented every 100th sec) and divide by 100 (hz)
    or (2) read sysinfo.updates (which is incremented every time the kstats are updated).
    I have attached a sample program that demonstrates both of these and reports average freemem since boot in K (like vmstat).
    Similarly, to get a 5 second average, take two readings of freemem and sysinfo.updates five seconds apart , then calculate
    (freemem2-freemem1)/(updates2-updates1)
    It seems most, if not all, of the system counters are cumulative in this fashion.
    Hope that helps.
    Ralph
    SUN Developer Technical Support
    <pre>
    #include <stdio.h>
    #include <stdlib.h>
    #include <unistd.h>
    #include <kstat.h>
    #include <sys/types.h>
    #include <sys/time.h>
    #include <sys/sysinfo.h>
    #include <stdio.h>
    main()
    kstat_ctl_t *kc;
    kstat_t *vminfo_ksp;
    kstat_t *system_misc_ksp;
    kstat_t *sysinfo_ksp;
    kstat_named_t *lbolt_knp;
    vminfo_t vminfo;
    sysinfo_t sysinfo;
    int hz;
    int ltime;
    ulong_t updates;
    if ((kc = kstat_open()) == NULL)
    perror("kstat_open failed"); exit(1);
    /* get lbolt and divide by hz to get secs since boot */
    system_misc_ksp = kstat_lookup(kc, "unix", 0, "system_misc");
    kstat_read(kc, system_misc_ksp, NULL);
    lbolt_knp = kstat_data_lookup(system_misc_ksp, "lbolt");
    hz = sysconf(_SC_CLK_TCK);
    ltime = lbolt_knp->value.l/hz;
    /* get number of statistic updates so far (=secs since boot) */
    sysinfo_ksp = kstat_lookup(kc, "unix", 0, "sysinfo");
    kstat_read(kc, sysinfo_ksp, &sysinfo);
    updates=sysinfo.updates;
    printf("lbolt time %d\n",ltime);
    printf("updates %d\n",updates);
    /* get vminfo */
    vminfo_ksp = kstat_lookup(kc, "unix", -1, "vminfo");
    kstat_read(kc, vminfo_ksp, &vminfo);
    printf("freemem %lld\n",(vminfo.freemem*4)/updates);
    printf("freemem %lld\n",(vminfo.freemem*4)/ltime);
    </pre>

  • How to find the right bapi.....

    Hi everyone!
    I'm having trouble in finding the right bapi for my program. I'm looking for a bapi that will create a sales order with reference to quotation no. and it seems dat, i dont have any background in bapi.. can someone help me to do this job? Can someone provide the right code for this problem? Thank you in advance..helpful reply will be given enough points..
    Regards,
    Mackoy

    <b>To find a BAPI:</b>
    Go to SE37.
    Click on F4 in the input field.
    go to Information Systems.
    In the Function module name type keyword and press enter.
    You will get a list of all the FMs containing that key word.
    From these search the one you think is appropriate for your requirement.
    This will be helpful in finding BAPIs/ FMs in future.
    Regards,
    Sonal
    <b>Reward points if helpful</b>

  • How to find the exact word in a long text?

    Hi,
    Scenario:
    I have long text containing the system status of the equipment.
    Issue:
    I need to find the exact word from the list of the statuses. I have tried to use the FIND keyword but it does not work for all the cases.
    Example:
              FIND 'REL' IN <status_list> IGNORING CASE.
              if sy-subrc = 0.
              " do something
              endif.
    If the status list contains the word 'RELR', the sy-subrc is set to 0 (which may be because it searches the list based on a pattern) but I want to get the exact match.
    Can anybody suggest me on this.
    Regards
    s@k

    >
    siemens.a.k wrote:
    > Dear Kiran, Vasuki,
    >
    > The data type of status list is char with length 40.
    > The status list:
    >
    > Case 1: list -  REL  MANC NMAT PRC  SETC
    > FIND 'REL ' IN <status_list> IGNORING CASE
    > the sy-subrc is set to 0
    >
    > Case2: list - CRTD MSCP NMAT PRC  RELR SETC
    > FIND 'REL ' IN <status_list> IGNORING CASE
    > the sy-subrc is still set to 0 even though the list does not contain the word 'REL'
    >
    > I have also tried using
    > if <status_list> CS 'REL'
    > and
    > if <status_list> CS 'REL '
    >
    >
    > Please do let me know if I am anyway unclear about issue...:)
    >
    > Regards
    > s@k
    This is becacuse when you check
    > Case2: list - CRTD MSCP NMAT PRC  RELR SETC
    It is having RELR so that is the reason you are getting subrc = 0.
    >Ok try CS it should work perfectly.
    It seems... CS also not the correct answer
    (It will count RELR)  below thread sachin is correct ...Do that way ....
    Regards
    sas
    Regards
    Sas
    Edited by: saslove sap on Jan 25, 2010 6:58 AM

  • How to find the right OSS Note for my SAP version

    Hi All,
    There have been issues with the Vendor/Material Master records whenever we run a LSMW by recording process. It is such that all those fields that we have not updated come up with a value as *DELETED* for which i think we should implement a OSS Note to our system.
    I am unable to find the right OSS Note Number for this to our SAP system :
    SAP_APPL                          Support Pack: SAPKH50009    Components:Logistics & Accounting.
    Request you all to provide me with the correct OSS Note Number so that we can get this issue corrected as this has become very critical.

    Hi,
    As Jurgen wrote - it could be some programming problem.
    But, generally, if you find a SAP Note, that, in your opinion, can solve your SAP problem and it is not intended for your SAP version - simply write to SAP OSS.
    If this note really solves your problem, they will extend the validity of this note for your SAP version.
    Otherwise, if it is SAP problem, OSS will try to provide solution for it.
    I usually act like this - it works.
    Hope it helps, not this time, maybe in the future.
    Regards,
    Wojciech

  • How to find the right XML files

    Hi all
    I need to customize OBIEE according to the custommers needs,Is there any tool to find the xml source files where I can make the changes.
    Currently I'm using 'psoug' to edit the page source code , for example I want to modify those values:
    <tbody>
    <tr>
    <td class="XUISectionHeadingTitle">Columns</td>
    </tr>
    <tr>
    <td class="XUISectionHeadingText">
    Click on column names in the selection pane to add them to the request. Once added, drag-and-drop columns to reorder them. Edit a column's format, formula and filters by clicking the buttons below its name.
    and I don't find the xml file to update it.
    Anyone knows how I can find it?

    *(BIInstallDir)\OracleBI\web\msgdb\l_en\messages*
    Under this path you can find the list of XML files....
    These XMLs are named to indicate what type of info it contain..

  • Finding the right words

    if i create a string array
    String lists[3] = { "code1---apple", "code2---apple", "code3---apple"};
    when the user asking for input , he type in code1
    it will print out "code1---apple" line.
    how to compare the user input with the array and print out the code1---apple line?

    hi...
    by using arrays you could set up 2 arrays, 1 for the code and 1 for the data where each data string corresponds to it's code...for example
    String codes[] = {"code1", "code2", "code3"};
    String data[] = {"apple1", "apple2", "apple3"};
    after getting the input code from the user you compare it to each element in codes[] until you find code that the user entered...you can initialize indexOfCode to -1 to see if a code was found or not...for example
    String input = //input form user
    int indexOfCode = -1;
    for(int i = 0; i < codes.length; i++)
    if(input.equals(codes)
    indexOfCode = i;
    break;
    now that you have the indexOfCode the same index of data[] will correspond to it's related code...so, to print out the code and it's data you could do this....
    if(indexOfCode != -1)
    System.out.println(codes[indexOfCode] + "---" + data[indexOfCode]);
    hope this helps you..

  • How to find the right script?

    I have a page with multiple files available (currently by
    download). A browser may want 1 or 10 files.
    I am trying to find the best scripting method for keeping
    notified of who is downloading which file (their email address).
    Thanks
    Aaron

    What scripting model are you using?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "InteractiveCommunications"
    <[email protected]> wrote in message
    news:e7eb6d$28d$[email protected]..
    >I have a page with multiple files available (currently by
    download). A
    >browser
    > may want 1 or 10 files.
    >
    > I am trying to find the best scripting method for
    keeping notified of who
    > is
    > downloading which file (their email address).
    >
    > Thanks
    > Aaron
    >
    >
    >
    >

  • How to match the nth word in a string?

    Hi, when I have a string like
    "AA BBBB CCC DDDDDD EEE FF"
    all words are of the form \w+
    and I'd like to match the nth word, for example the third would be "CCC",
    how can I establish this with just one regular expression?
    Some annotations:
    This is done with Java 1.4, but tools like the string tokenizer are not
    possible (restrictions of the application) We're limited to one regular expression!
    In Perl, one would do it this way:
    This would be the regular expression:
    "[\w+\s+\w+\s+](w+)"
    and with the help of $1, you might match the first paranthesis.
    As I said before, this is no solution here, because we're limited to one
    regular expression
    Another idea for Java Regex would be to define a positive lookahead, like (?<=\w+\s+\w+\s+), but as the width of it is variable, it is not allowed!
    Thanks for your help,
    Heiko Kubidsky

    well, i did another test class
    import java.util.regex.*;
    public class NthMatch {
    public static void main(String[] args) {
      Pattern p = Pattern.compile(
        "(?:\\w+\\s+){" + args[1] + "}(\\w+)(?:\\s.*)?");
      Matcher m = p.matcher(args[0]);
      if (m.matches())
       System.out.println(m.group(1));
      else
       System.out.println("no match");
    }run: java NthMatch "aa bb cc dd" 2
    does that help?
    what kind of framework you have to squeese the regex in?
    what do you want to do with that regex?
    do you want to check if Nth word maches something, or do you want to retriev that Nth string? or are you trying to do anything else?
    your explanation is unfortunatelly not sufficient :(

  • How to write the right pattern to replace string after a static string?

    select regexp_replace('Do not replace CONSTANT "VAR_123" should be replaced ', 'CONSTANT "[A-Z0-9]' ,'CONSTANT "REPLACE') from dual;
    Output is:
    Do not replace CONSTANT "REPLACEAR_123" should be replaced
    Proffered output is :
    Do not replace CONSTANT "REPLACE" should be replaced
    What is the right pattern to solve my problem?
    Help is needed.
    Regards

    different solutions possible
    /* replace everthing in between "" */
    select regexp_replace('Do not replace CONSTANT "VAR_123" should be replaced '
                        , '"([A-Z0-9_]*)"' ,'"REPLACE"')
    from dual;
    Do not replace CONSTANT "REPLACE" should be replaced
    /* replace UPPER letters, Numbers and Underscore after keyword CONSTANT an in between "" */
    select regexp_replace('Do not replace CONSTANT "VAR_123" should be replaced '
                        , '(CONSTANT) "([A-Z0-9_]*)"' ,'\1 "REPLACE"')
    from dual;
    Do not replace CONSTANT "REPLACE" should be replaced
    /* replace alphanumerica values including underscore after keyword CONSTANT an in between "" */
    select regexp_replace('Do not replace CONSTANT "VAR_123" should be replaced '
                        , '(CONSTANT) "([[:alnum:]_]*)"' ,'\1 "REPLACE"')
    from dual;One problem was that you did't take into account how the underscore "_" is recognized.

  • How to find the right customizing adapter object for a R3 table?

    I customized a document type ZCRM in the R/3. Now i want to do the synch load for document types using R3AS to see if it goes to the CRM system.
    When i check TR VOV8 in R/3 customizing,  i see that table TVAK is used in R/3  to store my document type ZCRM
    Then i try to find out, to which customizing adapter object table TVAK belongs. It is described in course TCRM20 Unit 9: I check table SMOFTABLES in the CRM system using TR SE16 and search in the column R3TABNAME for tablename TVAK. But it isn´t there...
    What am i doing wrong? How can i transfer my document type?
    Thank you

    Thanks - you are right - document types/transaction types and item categories cannot be transfered at all
    I just transfered customizing adapter object DNL_CUST_PRICE because R/3 table T052 (payment terms) is included in this adapter object. I customized payment term ZCRM in R/3. A check shows a green light. Now i want to check in which table in CRM my payment terms landed?
    Table T052 does not seem to exist in CRM.
    A detail insight in adapter object DNL_CUST_PRICE  by transaction R3AC3 to check the target table in CRM shows an empty column 'Mapping structure target site'. Where could i look?
    Thank you

  • How to find the right info on maximum ram expansion

    I have a MacBook Pro model 3,1 identified by the support pages also as MacBook Pro 15" /2.2/2.4 GHz. I would like to increase its system memory capacity maximally (presently 2 Gb). On the page MacBook Pro (Late 2006) - Technical Specifications which I found by entering the serial number (W87445ASX91) it says that max capacity is 3 Gb. On the other hand, on the page MacBook Pro: How to remove or install memory - Apple Support it says that maximum capacity for "MacBook Pro (15-inch 2.4/2.2 GHz)" is 4 Gb. Which one is correct? How can I find out?
    Regards
    Dan

    Hello danbae and welcome to Apple Support Communities,
    When I run your serial number here:
    http://www.chipmunk.nl/cgi-fast/applemodel.cgi
    I get:
    "Nice Name: MacBook Pro 15 inch Core 2 Duo SR (Mid/Late 2007)
    Machine Model: MacBookPro3,1
    Please visit our facebook page
    Name: MacBook Pro (Mid 2007)
    ModelCode: mbp_mid_07
    Family name: A1226
    Model Number: MA895
    Group1: MacBook
    Group2: Pro
    Generation: 31
    CPU speed: 2.2GHz
    Screen size: 15 inch
    Screen resolution: 1440x900 pixels
    Colour: Aluminium
    Return Key: Please tell us what model keyboard this model has. Do you have a US style HORIZONTAL, or ISO style VERTICAL return key on the keyboard?
    Production year: 2007
    Production week: 44 (November)
    Production number: 6146 (within this week)
    Model introduced: 2007
    Capacity: 120GB
    Memory - flavour: DDR2-S-667
    Memory - number of slots: 2
    Memory - maximum total: 6GB
    Memory - largest module: 4GB
    Factory: W8 (Shanghai China)"
    And
    Low End Mac says:
    "RAM: 2 GB, expandable to 6 GB using PC2-5300 DDR2 RAM"
    But call OWC:
    https://www.macsales.com/
    They are very dependable and always stand behind what they sell you.

  • How to find the user exit for the T-code 'RECN'

    Hi friends,
    I have a requirement as-
    In 'General Data with Fast Entry' tab of tcode 'RECN' there are 2 fields as contract conclusion date and contract end date.
    Now, the requirement is as if entered contract end date is less than contract conclusion date then we have to display a warning message as "contract end date cannot be less than contract conclusion date".
    So, how to find the right user exit to enter the code.
    Plz help me.I will surely reward points.
    Thanks,
    Rishi

    Hi Rishi,
    If User exits and BAdi's are not provided,  then  you will for Enhancement points.
    Procedure:
                     When you are in a particular transaction, Go to System--> status and you find the standard program of that particular screen. Go to SE38 and give that program name, display mode.
    After that you click on the spiral icon there onthe top. Then,
    You go to menu bar, Edit> Enhancement opitons> show implicit enhancement options.
    You will be shown the points where you need to write the code.
    For creating it you will go to Edit >  Enhancement opitons> Create.
    By this you will add some code in the standard programs.
    Reward points if it helps you.
    Cheers,
    Swamy Kunche

Maybe you are looking for

  • Error when calling a stored procedure from a SQL Script

    Apologies if this is a really dumb question but I can't seem to call a procedure in package from a SQL script. I have a simple package.procedure containing a loop to populate a table. I would like to include a call to this procedure from my database

  • HT1414 Ipod Mini not working after trying to update to IOS7

    Team Apple....HELP! I recently tried to in tall the new IOS 7 on my Mini Ipad....but I get the connect to Itunes with USB cable on the screen.  I've intalled the latest updates to the OS on my MAC Laptop and the latest version of Itunes. Itunes saw a

  • How to knock off CVD clearing account?

    The Miro for custom vendor will debit CVD clearing accout. And exicise invoice will credit CVD clearing accout and debit RG a/c,but the vendor is suppier. Due to This Issue Our GRIR reports (GL also) of custom vendor Shows excess Debit Balance. Can a

  • Firefox 4.0.1 hangs HARD on XP (cannot kill process)

    Multiple times is recent weeks (since the Firefox 4.0.1 update), Firefox has hung on my XP laptop after time (no other obvious influence) and CANNOT be killed! I have had to reboot every time, since no XP process-kill approach works. Presumably, ther

  • Updating Loading Group on plant record using BAPI

    I am using BAPI to extend to a plant BAPI_MATERIAL_SAVEDATA I am passing                        plantdata-loadinggrp   = wa_plantdata-loadinggrp.   plantdatax-loadinggrp  = 'X'.   plantdata-plant        = p_p_plant.   plantdatax-plant       = p_p_pla