Part of String replace * with space

Hello,
I am trying to come out with 0915 SCWB FU from the BS1  
564529*5*201311110915*SCWB FU as part of a case statement where a record startd with BS1, any help with be much appreciated.
Regards
Jo

SELECT RIGHT (col,12) FROM tbl
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence

Similar Messages

  • Warning:Null charecters(00H) contained in the file was replaced with spaces

    Hi,
         i am creating dat file in that at the end of each line i am adding 10 spaces(i.e 00a0) and end of line charecter, than sending to FTP server, but when i am opening file it is giving warning message : Null charecters(00H) contained in the file was replaced with spaces . Pls help me.
    Regards,
    Manoj
    Edited by: manoj kv on Oct 27, 2011 7:07 AM

    Hi,
      Instead at end of each line add a constant of type char with length 10. And then do a carriage return. Check if you still get the error.
    Regds,
    Madan...

  • Hi expert. replace . with space

    HI expert.
    I want to replace '.' with space . so I proceed below.
    itab is composed to two feilds.
    date1 type char10
    date2 type char10
    the field's values are '2011.01.01'.
    REPLACE ALL OCCURRENCES OF REGEX '\b(.)\b'
            IN TABLE ITAB WITH SPACE
            RESPECTING CASE.
    result.
    date1 : '2011010120'
    date2 : '110101'
    but I want the result below.
    date1 : '20110101'
    date2 : '20110101'
    what should i do?
    please help.

    Hi Jake,
    Using convert date to internal as mentioned by Zafar is a good idea, i don't see how this concerns the no of records, do update the post if you have a special requirement/concerns about using that FM.
    Anyways the other way to do it using the offsets,
    data: l_data type char10 value '2011.01.01',
    l_date2 type char10.
    concatenate l_data+0(4)  l_data+5(2) l_data+8(2) into l_date2.
    or
    l_date2+0(4) = l_data+0(4).
    l_date2+8(2) = l_data++5(2).
    l_date2+8(2) = l_data+8(2).
    Regards,
    Chen

  • Suppress Underscore and replace with Space in FR

    Hi
    Hyperion Financial Reporting 11.1.2.1
    In the excel, with a Essbase add-in, we have an option as Suppress--->Underscore Characters
    This will eliminate the Underscore and replaces with a space
    I want to know if the same functionality exists in the FR Studio
    Any insight would be much appreciated
    Regards
    Tejo jagadeesh

    Sorry, I misread your question. I thought it would be doable though Conditional Format: http://docs.oracle.com/cd/E17236_01/epm.1112/fr_user/ch10s02.html
    Something like this:
    If Member Name > Dimension > contains > _ > Format Cells > Replace >
    But then it replaces the whole member with space which I believe is not something you are looking for.
    One other option is to have another alias table in your database and select the new alias table in FR. I know this is an option for Essbase. I am not so sure about other db connections.
    Cheers,
    Mehmet

  • Find and Replace with space or tab

    Hi,
    I have a text file that has commas separating values. I saved it as a csv, but am not getting the results I need with the csv file. I'd like to replace the commas with a space or a tab.
    I know how to use find replace, but I do not know how to indicate these non-printing characters. I tried the ascii code &#32 for space, but i simply get that string of characters replacing my commas.
    ANy help?
    Thanks

    KW,
    You didn't say what program you were using for the Find and Replace, but I'd suggest that Pages would be your best bet. Spaces can be typed-in directly, and several other non-printing characters can be inserted from a drop-down menu.
    The Insert drop-down seems to be available only in Pages, as opposed to Numbers and TextEdit.
    Jerry

  • How to do a string replacement with a special characters?

    Hi there, I've a string which I need to do a replacement in but replaced and/or replacement contain a special chars.
    I.e. like this:
    newConvertedString = newConvertedString.replaceAll("</soapenv:Body>", "");
    newConvertedString = newConvertedString.replaceAll("<default:edit-config>", "</default:edit-config>");
    It does not do anything. I know that repalceAll(regexc., regexp.) but what can I use instead??
    Thanks ina advance

    qavlad wrote:
    Thanks 'jverd'. Just one more question - do you know if there any limit on the replacement string/regex used with/in .replaceAll()??No, the only limit would be the limit on how big a string can be and how much memory you have. However, anpoorly written regex on a long String will take a long time to execute.
    Seems like when I'm trying to replace one like this (and even a longer ones) it does not replace anything while it's there.
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header><wsse:Security xmlns:wsss="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wssa="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    Then there was no match.

  • How to show string value with spaces in seperate columns

    Hi all, I'm using Oracle 10g.
    create table
    create table sample_test (
      Name    VARCHAR2(20 BYTE))insert table
    insert into sample_test values ('JOAN   SCT')
         insert into sample_test values ('MELIA FILCK')
          insert into sample_test values ('SSAN LIER-LILEY')
           insert into sample_test values ('C.M. DANY WES')
               insert into sample_test values ('A L SCOTT')select * from sample_test;
    Name
    JOAN   SCT
    MELIA FILCK
    SSAN LIER-LILEY
    C.M. DANY WES
    A L SCOTTi would like the output as follows
    NAME1        NAME2      NAME3
    JOAN          SCT              
    MELIA        FILCK              
    SSAN       LIER-LILEY
    C.M.          DANY       WES
    A             L          SCOTTwhen ever there is a space in the name the value next to that should be shown in an other column. please note the first name joan sct has two spaces. but it needs to be treated as single space.
    also is it possible to get something like this
    NAME1        NAME2    
    JOAN          SCT              
    MELIA        FILCK              
    SSAN       LIER-LILEY
    C.M.DANY       WES
    A L          SCOTTthe value before first space on the right should be in name2 everything else in name1 field.
    Thanks in advance.

    Hi,
    Since you have Oracle 10, you can use regular expressions:
    For the 3-column output:
    SELECT        REGEXP_SUBSTR (name, '[^ ]+', 1, 1)     AS name1
    ,        REGEXP_SUBSTR (name, '[^ ]+', 1, 2)     AS name2
    ,        REGEXP_SUBSTR (name, '[^ ]+', 1, 3)     AS name3
    FROM        sample_test;     [^xyz]     means "any character except x, y or z".
    +     means "1 or more of the preceding"
    The 4th argument to REGEXP_SUBSTR tells which occurrence of the pattern we want.
    For the 2-column output:
    SELECT        REGEXP_REPLACE (name, ' *[^ ]+$')     AS before_last_space
    ,        REGEXP_SUBSTR  (name,   '[^ ]+$')     AS after_last_space
    FROM        sample_test;$     here means "the end of the string".
    In Oracle 10, you often have to use REGEXP_REPLACE to get substrings.
    Thanks for posting the CREATE TABLE and INSERT statements; that's very helpful!
    Edited by: Frank Kulash on Sep 7, 2011 3:21 PM

  • Replacing comma with space

    Hi,
    Note : I am using SAP 4.6
    Task      : Replace Comma with space
    Problem : Not able to replace comma with space
    I have task where I have to write result file to application server, when I am writing string to application server it is separating by comma, for example if you take below statement it is dividing by space that means in first column PO and then ITEM etcu2026.
    MOVE  'PO ITEM is not there in table EKPO' TO W_RECORD_OUT-ERROR_MSG.
    so to resolve this situation I have used below code for now, I know I can use
    REPLACE ... ALL ENTRIES but this statement is not working in SAP 4.6
    REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
    appreciate if somebody can help me.
    Thanks
    sarath

    Hi,
    Please check the below code.
    REPORT  YSAT_TEST.
    Data: Var1(40) type c value 'Test1,Test2,Test3,Test4'.
    break-point.
    REPLACE ',' WITH space INTO Var1.                   " It will replace only first occurrence
    replace all occurrences of ',' in var1 with '   '.
    CONDENSE Var1 no-gaps.
    write: var1.

  • Replacing unauthorized characters with space

    Hi friends,
    There is a set of authorized characters. The authorized characters are
    abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<space>
    If any character other than these characters should be replaced with space.
    For example, "I like foot-ball" should be changed to "I like foot ball"
    "Where are you?" should be changed to "Where are you"
    "red / blue" should be changed to "red   blue"
    I use Oracle 11.2.
    Thanks in advance!

    Using regular expression you can do this.
    SQL> with t
      2  as
      3  (
      4  select 'I like foot-ball' str
      5    from dual
      6  )
      7  select str
      8       , regexp_replace(str, '[^a-z0-9[:space:]]', ' ', 1, 0, 'i') new_str
      9    from t;
    STR              NEW_STR
    I like foot-ball I like foot ball
    You can read more about regular expression from the document.
    Using Regular Expressions in Oracle Database
    Message was edited by: Karthick_Arp
    Edited the Pattern after seeing franks post.

  • Padded zeros which is removed need to be replaced by spaces

    Hi Friends,
    My requirement in XI is : Padded zeros which is removed need to be replaced by spaces.
    for removing padded zeros I used the UDF:
    int i = Integer.parseInt(a);
    return (Integer.toString(i));
    It is working fine.
    Please help as how to go abt in coding : whatever zeros get taken off , need to be replaced with spaces.
    Thanks in Advance,
    Meghna.

    Hi Raj,
    According to the logic given by Henrique, its working. But the point to the noted is that :
    The number of spaces need to be equal to the number of zeros removed, where it not happening in this case.for the below Ex when applied it returned '  12345' instead of '    12345'.
    For ex. source field is '000012345' then the target field need to be '    12345'.
    the Type declared in the data type for the receiver field is integer with length 15.
    Is it possible to move the field value to the right justified, so the the padded zeros code when applied will automatically load spaces.Becoz the code written for removing zeros contains String due to which it is left justified i think.
    The code written for removing zeros is :
    int i = Integer.parseInt(a);
    return (Integer.toString(i));
    please suggest in this regard.
    Regards,
    Meghna.
    Edited by: meghna swaraj on Feb 27, 2008 6:05 PM

  • Replacing multiple spaces with another character

    i need to replace multiple spaces with another char in a string
    my code is
    Dim text as String="a bit much             a little much" Dim arr As String() = text.Split({" "c}, StringSplitOptions.RemoveEmptyEntries)Dim newtext As String = String.Join(" ", arr)            MsgBox(newtext)           
     it returns to "a bit much  a little much "
    But i want to replace only long spaces with "="  as  "a bit much =a little much"
    How can i do that?

    This version uses two spaces to split the string and then trims any additional single spaces. It returns "a bit much = a little much".
    Dim text As String = "a bit much a little much "
    Dim parts() As String = text.Split({" "}, StringSplitOptions.RemoveEmptyEntries)
    Dim newText As String
    If parts.Length = 2 Then
    newText = parts(0).Trim & " = " & parts(1).Trim
    End If

  • How to used REGEXP_REPLACE  for replace part of string ?

    hi
    How can i replace part of string as following , i want to replace space in date by "-"
    SELECT
    REGEXP_REPLACE(upper('Daivd bought stuff by 2000 USD on 12 Sep 2012 from KL and left kl on 20 Sep 2012'),
    '[0-9]{1,2}[^0-9](JAN|FEB|MAR|APR|JUN|JUL|AUG|SEP|OCT|NOV|DEC)[^0-9][0-9]{4}',
    ' ','-') "REGEXP_REPLACE"
    FROM DUAL;
    the output will be like this
    Daivd bought stuff by 2000 USD on 12-Sep-2012 from KL and left kl on 20-Sep-2012
    regards

    I thought the questions is answered.
    Your code will not work, because the alternate expression applies only to the four digit year and the month.
    If you want to recognize both date formats with one expressions, you have to group the complete expressions.
    The disadvantage of this would be, that the backreferences would not work in the same way because you would have more groups.
    I advice to use two separate regular expressions for this task.
    Take a look at the following example if you simply want to fill the gaps with -:
    with yourtable as
      select 'Daivd bought stuff by 2000 USD on 12 Sep 2012 from KL and left kl on 20 Sep 2012' text from dual union all
      select 'Daivd bought stuff by 2000 USD on Sep, 20 2012 from KL and left kl on Sep, 20 2012' text from dual 
    SELECT
    REGEXP_REPLACE(
    REGEXP_REPLACE(text,
    '([0-9]{1,2}) (JAN|FEB|MAR|APR|JUN|JUL|AUG|SEP|OCT|NOV|DEC) ([0-9]{4})','\1-\2-\3',1,0,'i'),
    '(JAN|FEB|MAR|APR|JUN|JUL|AUG|SEP|OCT|NOV|DEC), ([0-9]{1,2}) ([0-9]{4})','\1-\2-\3',1,0,'i') regexp_replace
    FROM yourtable;If you want same output-format for both date formats you could use this:
    with yourtable as
      select 'Daivd bought stuff by 2000 USD on 12 Sep 2012 from KL and left kl on 20 Sep 2012' text from dual union all
      select 'Daivd bought stuff by 2000 USD on Sep, 20 2012 from KL and left kl on Sep, 20 2012' text from dual 
    SELECT
    REGEXP_REPLACE(
    REGEXP_REPLACE(text,
    '([0-9]{1,2}) (JAN|FEB|MAR|APR|JUN|JUL|AUG|SEP|OCT|NOV|DEC) ([0-9]{4})','\1-\2-\3',1,0,'i'),
    '(JAN|FEB|MAR|APR|JUN|JUL|AUG|SEP|OCT|NOV|DEC), ([0-9]{1,2}) ([0-9]{4})','\2-\1-\3',1,0,'i') regexp_replace
    FROM yourtable;Edited by: hm on 25.09.2012 22:00

  • Replace multiple space characters with a single space

    Hi,
    Oracle 11g R2.
    Looking for a way to replace multiple space characters in a row with a single space. For example, the text "abc abc" should look like "abc abc". I tried toying with replace, but it only works for the case of 2 spaces. Need a solution for the cases where there could be 2 or more spaces.
    select replace(column1, chr(32)||chr(32), chr(32)) from tablea

    Hi,
    If you had to do this without regular expressions, you could use:
    SELECT  REPLACE ( REPLACE ( REPLACE (str, ' ', '~ ')
                     , ' ~'
              , '~ '
              )     AS new_str
    FROM    table_x;assuming there is some sub-string (I used '~' above) that never occurs right next to a space.
    However, unless you're uisng Oracle 9 (or earlier, which you're not doing) you don't have to do this without regular expressions. As you can see, the way Solomon showed is much simpler.

  • How to concatenate a string with spaces

    Dear experts,
    I would like to concatenate a string with three spaces, for example,
    CONCATENATE 'X' SPACE SPACE SPACE 'Y' INTO LV_RESULT.
    However, the result I got from executing the above statement is not 'X   Y' as I want, but rather 'XY'.
    I did try
    CONCATENATE 'X' '***' 'Y' INTO LV_RESULT.
    REPLACE '***' with '   ' INTO LV_RESULT.
    still doesn't work.
    How can I write ABAP code to archive such a result?
    Any idea would be appreciated.
    Vitthavat A.

    dear  Oliver Hütköper and koolspy,
    I tried your solutions, and it works.
    so i awarded points to you.
    anyway, while trying the 'respecting blanks', i got an error:
    "".", "IN BYTE MODE", "SEPARATED BY ..." or "IN CHARACTER MODE" expected"
    not sure what it means. but it's ok. the problem has been solved.
    thanks again.

  • Replacing # with blank space in Bex Analyser

    Hi All,
    Can any one help me out in replacing # values in Bex analyser with blank space.
    I tried with the macro:
    Sub SAPBEXonRefresh(queryID As String, resultArea As Range)
    ' First Query in the workbook
    If queryID = "SAPBEXq0001" Then
    ' Selects the area where the report query is rendered
    resultArea.Select
    'Replace "" with 0
    Selection.Cells.Replace What:="", Replacement:="0", LookAt:=xlWhole, _ SearchOrder:=xlByRows, MatchCase:=False, MatchByte:=True
    End If
    End Sub
    Means I have include the macro to the Excel, but still it is not working.
    If this macro is the correct solution, then may be I am not using it properly(in the sense I'm not calling with proper syntax).
    Please provide me with the solutiuon to get rid of this problem.

    Hi,
    We are using BEX 7.0.
    I got a macro code which is working. The code is as follows.
    Dim resultArea As Range
    Set resultArea = varname(1)
    Dim c As Range
    For Each c In resultArea.Cells
    If c.Value = "#" Then c.Value = " "
    Next c
    This works fine but the problem is that this macro code should be added each and every time when the query is run.
    Can any one suggest me where the code can be added in Bex Analyzer itself, so that when the query is run the above macro runs along with it and removes the #.
    Thanks and Regards,
    Geetha.

Maybe you are looking for

  • How can I set my privacy tighter with Siri and Dictation?

    OK First of all, Apple needs to stop with the restriction of what you can say in posts. They keep deleting my stuff without allowing my QUESTION to be answered. First of all, when did this massive invasion of my privacy happen? Did it happen with the

  • Oracle fusion Middleware 11g -- forms issue while hitting url

    Hi , we are facing one issue while hitting the url mentioned below http://scrmskr.apac.nsroot.net:7801/forms/html/CRMS_KR.htm FRM-92052:fatal error: cannot connect to the server at URL /forms/lservlet here in the above CRMS_KR.htm we have hard-coded

  • Some questions regarding SSLSocket

    Hi, I'm trying to write application (3 servers and 1 client) that will be using ssl. I've got a question - is one keystore enough for 3 server and 1 client and will it provied secure conncetions for all (for example server1<->server2, server3<->clien

  • Just wondering........ Verizon Centro syncing w a Mac

    I am due for a new phone, from Verizon. I like the Centro, and I have been looking at many articles & forums online. Here is my concern. Can you sync Apple Addressbook & iCal, with Centro via USB without having to buy a 3rd party software? If that do

  • Crashing before game software installed

    I just now purchased a game but just after it asked for payment it crashed before installing. It then asked me to purchase again which I did thinking the first one wouldn't have worked. The second one downloaded correctly. Then when I checked my emai