Removing number appended at the end from a string field

Hi,
I have a string field which has numbers appended to its end. I need to remove the numbers and display only the string values.
The string is not of fixed length, and the numeric values can be single digit or 2 digits and might be separate by a space but not always.
Here is some sample data:
SHOWCASE NOTT12
SHOWCASE PETE12
SHOWCASE BRIST7
SHOWCASE READI1
CINEDROME PAD1
RITZ BELPER   1
STEPH.JOSEPH S1
I need to display this as below (without any numbers appended at the end)
SHOWCASE NOTT
SHOWCASE PETE
SHOWCASE BRIST
SHOWCASE READI
CINEDROME PAD
RITZ BELPER  
STEPH.JOSEPH S
Please let me know how this can be achieved.
Thanks!

Hi there,
Just a quick option is to use the REPLACE function, i.e.
REPLACE(REPLACE(REPLACE({contr_actv.dept_id},'1' ,''),'2', ''), '3', '');
You just have to build it up a little more so it caters for numbers 0 - 9.  At the moment it only works for numbers 1 - 3.  Another way you could do this is write some code to loop through the length of the string looking at each individual character to test for a number.
I don't have time today to write something like that but the above should work as long as you don't have numbers in the middle of names etc.
Cheers,
Chris

Similar Messages

  • Append a substring to the end of a string

    I'm trying to dynamically generate my "where" clause for a
    SQL query. I'd like to append a substring to the end of an existing
    string. I tried "ListAppend", but of course that puts a comma
    between the original string and the substring. I could use "Insert"
    string function, but it seems rather a hassle to have to LEN the
    existing string each time I want to append something to the end of
    it. Is there an easy way to append a substring to the end of a
    string?
    Here's an example of the code (using the "ListAppend" that
    doesn't work):
    <CFSET whereStmt = "ads.ad_duedate + INTERVAL 1 DAY >=
    NOW()">
    <cfswitch expression="#vendorSort#">
    <cfcase value="Yes"><CFSET whereStmt =
    ListAppend(whereStmt, " AND ads.ad_vendor =
    #AdSortBy#")></cfcase>
    </cfswitch>

    On additional suggestion...
    You can use WHERE 0=0 as the first comparison in your where
    clause. This obviously is always true. The benefit is now you can
    have as many if statements adding conditions you want without have
    to worry about generating an invalid sql statement such as WHERE
    AND userid = 5 ie
    <cfset var sql = "">
    <cfset sql = "SELECT * FROM Users WHERE 0=0 ">
    <cfif GetOnlyActiveUsers()>
    <cfset sql = sql & "AND Active = 1 ">
    </cfif>
    Note that there is a space at the end of every line to ensure
    separation of statements.

  • Blog urls - BC allows any text to be appended to the end of blog urls

    I just ran a test crawl on our main site and the bot found 87 duplicate urls
    All the blog posts showed the post and then one identical post with /privacy-policy appended ot the end.
    The content is idendtical
    I am attempting to descover why only privacy policy is appended.
    My major concern is that any content can be appeneded to a blog post and show ducpolicate content.
    A malicious attacker could create a small script that takes all the post appends them with an infinante array of variables and post those links on websites, get the links indexed and then google would flag a site as having disprortionate amount of duplicate content.
    Any ssuggestions?

    You have privacy policy link with no foward slash in front of it.
    Thus when you are in a blog or other url with sub structure it thinks that it is another level down.
    Find the link and fix it.
    Your concerns on an attacker though are not correct, web and sub folders, if you said was true every url out there other then a root url would be malicius which is of course not true.

  • Earliar i can remove any selection in the page from right mouse key now i can't

    earliar i can remove any selection in the page from right mouse key now i can't

    See this article for some suggestions: [[Firefox has just updated tab shows each time you start Firefox]]
    See also http://kb.mozillazine.org/Preferences_not_saved and [[Preferences are not saved]]
    * [[How to set the home page]] - Firefox supports multiple home pages separated by '|' symbols

  • Need help in laoding flat file data, which has \r at the end of a string

    Hi There,
    Need help in loading flat file data, which has \r at the end of a string.
    I have a flat file with three columns. In the data, at the end of second column it has \r. So because of this the control is going to the beginning of next line. And the rest of the line is loading into the next line.
    Can someone pls help me to remove escape character \r from the data?
    thanks,
    rag

    Have you looked into the sed linux command? here are some details:
    When working with txt files or with the shell in general it is sometimes necessary to replace certain chars in existing files. In that cases sed can come in handy:
    1     sed -i 's/foo/bar/g' FILENAME
    The -i option makes sure that the changes are saved in the new file – in case you are not sure that sed will work as you expect it you should use it without the option but provide an output filename. The s is for search, the foo is the pattern you are searching the file for, bar is the replacement string and the g flag makes sure that all hits on each line are replaced, not just the first one.
    If you have to replace special characters like a dot or a comma, they have to be entered with a backslash to make clear that you mean the chars, not some control command:
    1     sed -i 's/./,/g' *txt
    Sed should be available on every standard installation of any distribution. At lesat on Fedora it is even required by core system parts like udev.
    If this helps, mark as correct or helpful.

  • How to move the value from a character field to numeric or packed decimal

    Hi,
    can anyone explain me on how to move the value from a character field to numeric or packed decimal.
    Please help me on this. Thanks...
    Regards,
    Rose.

    Hi ,
    if you use keyword MOVE u may loose the decimal and thoussan separator and if u don't want to loose them just call the FM ..HRCM_STRING_AMOUNT_CONVERT.
    i doubt wherther it is HRCM or HCRM just try using *
    this will suit ur requirement.
    Regards,
    KK

  • Remove Line feed at the end of the file while using file adapter

    Hi All,
    I have a requirement. We are sending a file from SAP to FTP using file adapter. we are successful in sending the file to FTP but at the end of the file a extra blank line is created .
    Can anyone please suggest how to remove the extra line feed at the end of the file.
    Thanks and Regards,
    LRK.

    check this:
    http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/frameset.htm
    To define an additional string as a separator after the last column in a row, specify it here. The system skips this string when it processes the last column (otherwise the system would treat it as part of the last column).
    Also there are solved threads which deal with same problem....you can even check them out...
    regards,
    Abhishek.

  • PI removing blank spaces at the end of the lines in a plain text file

    Hi -
    I have an interface that transfers a file via FTP. I defined both the sender and receiver to transfer either Text or Binary but the interface removes every blank space I have after the last character. The file is a fixed lenght file.
    Example:
    Original file:
    Hello world(space)(space)(space)(space)(space)(space)(space)(space)(eol)
    where (space) is the space character and (eol) is the end of line char.
    File after it is received.
    Hello world(eol)
    I already defined the parameter Row.fieldFixedLenghts with 10164 which is the lenght of the lines of the file.
    Any ideas why it may be happening?
    Thanks,
    Carlos.

    Hi -
    I tried both the parameters:
    xml.fieldContentFormatting
    structure.fieldContentFormatting
    The received file still has the problem. All the blank spaces are cleared out.
    The file is a plain text file not an XML file. May this be the issue?
    Thanks,
    Carlos.

  • Why is a number appended to the volume name on external hard drive, only in path?

    Last week I replaced a failing external drive. Using Disk Utility I partitioned it into two volumes, named them CCC and Warehouse (Warehouse is the problem). I had never had any volumes named Warehouse previously. In Finder the name shows correctly, until I click "Get Info", where the name is shown as Warehouse 1. All of the files on Warehouse show their paths as /Volumes/Warehouse 1. I don't know when the " 1" was appended to the name, or how it happened. It's screwing up my applications that write to or from the volume, the path is wrong. When I'm in Warehouse's "Get Info" I try to change the name back to Warehouse, but it immediately goes back to Warehouse 1. I copied everything off the drive, repartioned using the same names, and still have the problem. I notice if I change the name to something totally different, like "Fish", I don't get that problem. I would prefer to keep the name Warehouse though, if possible.

    I have noticed that the system can "hold onto" a drive name when there's a disconnect from the external volume.
    Try this. Eject your external drive. Go into Terminal, and type
    Cd /Volumes
    Do you see a phantom "Warehouse" volume still there? If so, navigate into it, make sure there are no files you might want to keep (copy them elsewhere if so), then navigate out and use
    sudo rm -rf /Volumes/Warehouse
    See if that fixes it.
    Matt

  • How to remove trailing space at the end of a song.

    This is related to this thread: Shorten song length (remove trailing bars) in Garageband 10.0.1
    I have also done some Googling and have found some links related to selecting and exporting regions, which I have tried, but this is what I noticed.
    It does not work when I select certain instruments, eg Synthesizer - Soundscape - Subtle Shiftscape or Synthesizer - Lead - Screamlead. I believe that what is happening is that those sounds tend to have some additional length to it. No matter where I cut my region, the additional length still get added. I don't have that problem if I don't select those instruments.
    Anybody has any ideas?

    Are you using GB 10.0.2 as well?
    I am using both - GarageBand 10.0.2 and GarageBand '11.
    And if I deselect all regions, File - Add Region to loop library is of course greyed out. Is it possible to save multiple tracks as a loop?
    No.
    Yep, I've deselected all regions. Still no luck.
    My answer above was in answer to your "This time GB felt I only needed the first 4 measures of the song, even though I defined an entire Region over the length of the song and selected everything with Ctrl-A..."
    You should be able to export the complete song, if you deselect all regions, and select all of the song using the cycle region with "Export Cycle region only" enabled, or with "Export Cycle region only" disabled, nothing selected, and the end-of-song marker correctly set.
    However, this will not get rid of the trailing empty bars.
    Reimport the bounced song to a new Ringtone project and trim it and save it as a tone, or to a regular project and add it to the Loop Library.
    Find the AIFF file of the loop in the Loop library - it will be installed in your User Library in your Home folder
    ~/Library/Audio/Apple Loops/User Loops/SingleFiles/

  • How to remove HTML comments at the end of the portal page

    Hi,
    I've noticed that even if you turn off performance comments, some code in the portal UI still sticks this:
    <!--Hostname: bdg-laptop--><!--Portal Version: 6.0.0.199938, Changelist: 199938, Build Date: 08/31/2005 at 07:49 PM-->
    at the bottom of every page.
    Does anyone know how I can suppress these comments?
    Thanks,
    Chris Bucchere | bdg | [email protected] | www.bdg-online.com

    Are you using GB 10.0.2 as well?
    I am using both - GarageBand 10.0.2 and GarageBand '11.
    And if I deselect all regions, File - Add Region to loop library is of course greyed out. Is it possible to save multiple tracks as a loop?
    No.
    Yep, I've deselected all regions. Still no luck.
    My answer above was in answer to your "This time GB felt I only needed the first 4 measures of the song, even though I defined an entire Region over the length of the song and selected everything with Ctrl-A..."
    You should be able to export the complete song, if you deselect all regions, and select all of the song using the cycle region with "Export Cycle region only" enabled, or with "Export Cycle region only" disabled, nothing selected, and the end-of-song marker correctly set.
    However, this will not get rid of the trailing empty bars.
    Reimport the bounced song to a new Ringtone project and trim it and save it as a tone, or to a regular project and add it to the Loop Library.
    Find the AIFF file of the loop in the Loop library - it will be installed in your User Library in your Home folder
    ~/Library/Audio/Apple Loops/User Loops/SingleFiles/

  • Add (concatenate) a string to the end of a numerical field value (custom format script)?

    Hello All!
    1) I have a form field where a customer can input mileage (e.g. 48,000)
    I would like to be able to dynamically place the comma in the proper place as well as add " miles" to the end of the value the user input.
    For example:
    If the user types "123456" into the field, I would like for it to display as "123,456 miles"
    I assume this will require some custom format javascript... I'm familiar with the general syntax of JavaScript, but don't really know specific keywords/object names to use, I have a few custom calculation scripts in the form, and I've done some simple thing like concatenate two fields into one, etc.
    But this is a little different, because I'm only working with data from one field. I tried:
    event.value += " miles";
    However, this causes " miles" to get added everytime ANY field changes... so I end up getting "123,456 miles miles miles miles" as the user makes changes to other fields.
    2) Also, to further complicate things, is it possible to "remove" the custom formatting when the field gains focus? For example, if you use Acrobat's default number format ($1,394.00) on a field, when the user selects that field to edit the value, the formatting "disappears" so that the user would only see "1394".
    I would like to achieve the same with my custom field, so when the user selected the field that displays "123,456 miles" to change the value, they would only see/edit "123456"
    A bit wordy, I know, but thanks for any help!

    Here's a simple way. Begin by creating a new document-level JavaScript and include the following code:
    function my_format() {
        // Format number (no decimal point, comma thousands separator, etc.)
        AFNumber_Format(0, 0, 0, 0, "", false);
        // Add " miles" if there is an entry
        event.value = event.value ? event.value + " miles" : "";
    function my_keystroke() {
        // Restrict entry to characters consistent with a number
        AFNumber_Keystroke(0, 0, 0, 0, "", false);
    For the field in question, add the following as the custom Format script:
    my_format();
    and the following as the custom Keystroke script:
    my_keystroke();
    George

  • How to get the vlaue from an input field without hitting the enter button ?

    Hello All,
      Is there some way to read the values of an input field that was filled in by an user eg ..
    String userEntry = wdContect.<UIElement>.value;
      So far, I am only able to achieve this using the onEnter property whoch really is not very user friendly since I can only read in the values only if the user hits enter.
      Any help will be appreciated.  Thank you.
    from
    Kwok Wei

    1. Create a value attribute (MyText) in the controller context
    2. Create a value attribute (MyText) in the view context
    3. Map view context attribute to controller context attribute
    4. Create InputField in the view and map the "value" attribute to the MyText view context attribute
    5. Create Action on view (Send)
    6. Create Send button and specify Send action as onAction attribute
    7. Create executeSend() method on controller
    8. onActionSend() implementation:
      public void onActionSend(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionSend(ServerEvent)
       wdThis.wdGet<controllername>Controller().executeSend();
        //@@end
    9. executeSend() implementation:
      public void executeSend( )
        //@@begin executeSend()
                   // Get MyText
                   String MyText = wdContext.currentContextElement().getMyText();

  • To remove leading zeroes and take directly from IDOC(Segment field) to file

    Hi SapAll.
    i have got a simple requirement in a idoc to file Interface.
    here in a sender Idoc there will be one segment with one field,the requirement is to remove leading zeroes and take directly the data from this field and map to one of the field in  reciever  file structure.
    i had used the formatnumber (under arithmatic functions)in PI 3.0 but now when iam using it in PI7.1 it was raising some jave exception error.
    it would be preferable if any body can give me the solution without user defined functions.
    regards.
    Varma.

    from your first post:
    i had used the formatnumber (under arithmatic functions)in PI 3.0 but now when iam using it in PI7.1 it was raising some jave exception error.
    use the same formatting that you used in 3.0 .... try with just a # in the FormatNum function.
    Regards,
    Abhishek.

  • How to take the values from a  String ( CSV   values).

    Hi All,
    I am passing csv String to a procedure as in parameter,but I have to take the values from a csv String one by one.Please let me know Is there any StringTokenizer function in oracle to take values like in java. Here is my javacode.
    import java.util.StringTokenizer;
    public class Sample {
         public static void main(String[] args) {
              String s="one,two,three,four,five";
              StringTokenizer stringTokenizer=new StringTokenizer(s,",");
              System.out.println( stringTokenizer.countTokens());
              System.out.println(stringTokenizer.hasMoreTokens());
              while(stringTokenizer.hasMoreTokens()){
                        System.out.print(stringTokenizer.nextToken());
    o/p: one two three four five

    Something based around one of these two methods should assist...
    select substr( the_string 
                  , decode( level, 1, 1, instr(the_string,',',1,level-1)+1)
                  , decode( instr(the_string,',',1,level), 0, length(the_string), instr(the_string,',',1,level) - decode( level, 1, 0, instr(the_string,',',1,level-1))-1)
                  ) the_value
                  from ( select '10,12,20,30,30,3,12,12,56' the_string
                         from dual
                  connect by level < length(replace(translate(the_string,'01234567890','00000000000'),'0')) + 2
    or
    SQL> select REGEXP_SUBSTR ('a,b,c,d,e', '[^,]+', 1, level) from dual connect by level<=5
      2  /
    REGEXP_SU
    a
    b
    c
    d
    e
    SQL>

Maybe you are looking for

  • Stupid me or stupid iTunes?

    Greetings -- I'm new to iTunes so forgive me if this is ignorant, but I've scoured these forums and google and can't find an answer. I just bought my ipod. Loaded up itunes (5 then now version 6) and am trying to move my collection of 400+ CDs into i

  • I lost my library and backups to a fire but had my Itouch with me , how do i get my "stuff" off my ITouch to my new library ???

    I lost my itunes library and backups to a fire but had my Ipod Touch with me, how do I get my "stuff" off my ITouch to my new computer and new Itunes library ?????

  • Bug in export to html

    Hi, I wanted to publish a preso to my iDisk, so I exported it as an html file. When I tried to add the page using HomePage, I got an error that said this: The "< BODY ... " tag is not closed properly with a matching ">" So, not really knowing much ht

  • CE prerequisits

    Hi, I'm running CE 7.1 SR3 Trial on a Windows Server 2003 32bit machine. We are now planning on switching  full version of CE. In the platform availability matrix (PAM) for CE document, the 64bit Windows version is a requirement. So does that mean th

  • Error during install " specify system property "is.debug" for more information."

    I am trying to install Livecycle Reader Extensions onto a Unix box and the setup.sh is giving the following error when I try to invoke it. "An unhandled error occurred -- specify system property "is.debug" for more information." Anyone know how to se