Replace tab character from string in ABAP

hi experts,
I have a string like this "a<tab character>b<tab character>c<tab character>d". for my processing i want the output like "abcd". How can i replace all occurances of this tab character from my string.
tab character = a hexa decimal character. I dont know the hex value for this.
regards
Raghav

hi you joined SCN in 2007 its a way long time to say.. ur new.. any ways.
after declaring the lv_tab as I said...
REPLACE ALL OCCURRENCES OF lv_tab in <string> with space.

Similar Messages

  • Replace a character from a string

    Hi,
    how can I replace a particular character from a string on a particular occurrence? Say for eg, if i wan to replace 'a' of second occurrence from 'abcabcabc', then what should i do? I guess the normal REPLACE function replaces every occurrence in a given string. So is there any other way to solve this?
    Thanks!

    If you are in 9i:
    Then you got to split the string into based on the nth position.
    SQL> select replace('abddefabc','a','x') from dual;
    REPLACE('
    xbddefxbc
    SQL> select instr('abddefabc','a',2) from dual;
    INSTR('ABDDEFABC','A',2)
                           7
    SQL> select substr('abddefabc',1,instr('abddefabc','a',2)-1),substr('abddefabc',instr('abddefabc','a',2)) from dual;
    SUBSTR SUB
    abddef abc
    SQL> select substr('abddefabc',1,instr('abddefabc','a',2)-1),replace(substr('abddefabc',instr('abddefabc','a',2)),'a','X') as replaced from dual;
    SUBSTR REP
    abddef XbcOfcourse, later on you can join the string..
    Jithendra

  • Replace read character from file

    HI,
    I have updated my labview 2014 and have a load and save function wich not working on the new version.
    It says that the read character from file is not supported any more.
    How to i fix it to run in labview 2014?
    Attachments:
    Load.png ‏62 KB
    Save.png ‏365 KB

    Bob_Schor wrote:
    Please do not attach tiny pictures of your VIs (I can't see them clearly).  Instead, attach the VIs, themselves -- this lets us open them in LabVIEW, see if there are any broken arrows, read the error messages, and actually try your code (any test any fix we might suggest).  Help us to help you.
    Do you know about Snippets?  This is what looks like a .PNG file, but can be dropped in a LabVIEW Block Diagram to become executable code.  Find it on the Edit menu of the Block Diagram.
    Bob Schor
    HI,
    OK, I have now attach my VIs.
    //Ronny
    Attachments:
    Save.vi ‏11 KB
    Load.vi ‏11 KB

  • Replacing a character in a string to another character

    hi,
    i need to write a function or procedure to replace the character of a string value suppose:
    l_error:= 'abcdefghijklmnop' is a string
    i need write a function or procedure to replace the character "c" to "z"
    that data in l_error is not in any table.
    thanks,
    AJ

    I want to Replace all the Existence of the word - "Test" in a string with "Test1" whereever a space exits before the word Test and someother alphabet after "Test" i.e. Test will be replaced with Test1 if a word starts with Test and contains more alphabets also. For example - TestName should be replaced with Test1Name while MyTest should not be updated to MyTest1.
    I have tried to use below query which uses oracle regular expressions -
    SELECT REGEXP_REPLACE('MYCOMPANY TEST TESTGEET INDIA PVT LTD TEST','\s(TEST)\w',' TEST1') FROM DUAL
    Output -
    "MYCOMPANY TEST *TEST1EET* INDIA PVT LTD TEST"
    Here, it has also replaced the G also from TESTGEET and resulted in TEST1EET while i want TEST1GEET.
    Can someone please suggest how can i do this..... may b m doing some silly mistake but sorry m a newbie to regular expression...
    Thanks in advance..

  • How to replace a character in a string with blank space.

    Hi,
    How to replace a character in a string with blank space.
    Note:
    I have to change string  CL_DS_1===========CM01 to CL_DS_1               CM01.
    i.e) I have to replace '=' with ' '.
    I have already tried with <b>REPLACE ALL OCCURRENCES OF '=' IN temp_fill_string WITH ' '</b>
    Its not working.

    Hi,
    Try with this..
    call method textedit- >replace_all
      exporting
        case_sensitive_mode = case_sensitive_mode
        replace_string = replace_string
        search_string = search_string
        whole_word_mode = whole_word_mode
      changing
        counter = counter
      exceptions
        error_cntl_call_method = 1
        invalid_parameter = 2.
    <b>Parameters</b>      <b> Description</b>    <b> Possible values</b>
    case_sensitive_mode    Upper-/lowercase       false Do not observe (default value)
                                                                       true  Observe
    replace_string                Text to replace the 
                                         occurrences of
                                         SEARCH_STRING
    search_string                 Text to be replaced
    whole_word_mode          Only replace whole words   false Find whole words and                                                                               
    parts of words (default                                                                               
    value)
                                                                               true  Only find whole words
    counter                         Return value specifying how
                                        many times the search string
                                        was replaced
    Regards,
      Jayaram...

  • Replace a character in a String array

    I have an array of strings and am trying to replace the ' character with a space. I keep getting either a cannot be applied or cannot resolve symbol error. Can anyone help?
    String arrayList = request.getParameter("field");
    String newList = arrayList.replace("\'", " ");

    the replace method of the String class takes two parameters and both of them are characters not strings use it like this
    arrayList.replace('\'', ' ');that should fix it

  • Replacing a character in a String

    Hi All,
    How can I replace a character ' which appears in a String into \'

    There is a method in String that replaces all
    occurrences of one character with anothercharacter.
    It's called, hold your breath now, "replace".But tho OP wants to replace one character with two
    characters :)You're right, I missed that. Well, serves me right for being sarcastic. :-)

  • Convert from String data type to Character data type

    Hi...,
    I'm a beginner. I try to make a program. But I don't know how to convert from string to data type. I try to make a calculator with GUI window. And when somebody put "+" to one of the window, I just want to convert it to Character instead of String.
    Sorry of my bad english..
    Please help me....
    Thanks

    String s = "a+b";
    char theplus = s.charAt(1);

  • AES256 bit encyption key from 64 character long string

    Hi,
    I have Oracle 10.2 on Windows 2003. I have recently started working on a project that requires encrypting information before sending it over. I have got 64 character long string to use it as a key.
    I am getting ORA-06502: PL/SQL: numeric or value error: raw variable length too long
    <pre>
    declare
    input_string VARCHAR2 (200) := 'SomeText';
    output_string VARCHAR2 (200);
    encrypted_raw RAW (2000); -- stores encrypted binary text
    decrypted_raw RAW (2000); -- stores decrypted binary text
    key_bytes_raw RAW (32); -- stores 256-bit encryption key
    encryption_type PLS_INTEGER; -- total encryption type
    begin
    DBMS_OUTPUT.PUT_LINE ('Original string: ' || input_string);
    encryption_type := DBMS_CRYPTO.ENCRYPT_AES256 + DBMS_CRYPTO.CHAIN_CBC + DBMS_CRYPTO.PAD_PKCS5;
    key_bytes_raw := UTL_I18N.STRING_TO_RAW('eiccmkjd94jfgniw03ljkdlfutcnv3209kfjd67023jlclmxzlmc9543ykflseu6', 'AL32UTF8');
    encrypted_raw := DBMS_CRYPTO.ENCRYPT
    src => UTL_I18N.STRING_TO_RAW (input_string, 'AL32UTF8'),
    typ => encryption_type,
    key => key_bytes_raw
    -- The encrypted value in the encrypted_raw variable can be used here
    decrypted_raw := DBMS_CRYPTO.DECRYPT
    src => encrypted_raw,
    typ => encryption_type,
    key => key_bytes_raw
    output_string := UTL_I18N.RAW_TO_CHAR (decrypted_raw, 'AL32UTF8');
    DBMS_OUTPUT.PUT_LINE ('Decrypted string: ' || output_string);
    end;
    Please let me know hot to convert 64 character long string in to 256bit key.
    Thanks
    -Smith

    smith_apex wrote:
    My client is using Java and they are saying that they are using this key for their AES256 Encryption and working fine. I have asked them to provide me 32 bytes key as in Oracle 256bit is 32 character string.
    Let me see what they have to say.
    I was wondering why Java has 64 bytes for 256 AES encryption when Oracle need only 32 bytes for same encryption.I am not sure I completely understand how those built-in packages work but the doc example produces the raw key that is same in length (in terms of number of characters) as the one you are using.
    Yet your UTL_I18N packaged function fails for your key but works for the documentation example.
    Documentation example:
    SQL> select * from v$version ;
    BANNER
    Oracle Database 10g Release 10.2.0.5.0 - Production
    PL/SQL Release 10.2.0.5.0 - Production
    CORE     10.2.0.5.0     Production
    TNS for Linux: Version 10.2.0.5.0 - Production
    NLSRTL Version 10.2.0.5.0 - Production
    declare
       input_string       VARCHAR2 (200) := 'Secret Message';
       output_string      VARCHAR2 (200);
       encrypted_raw      RAW (2000);             -- stores encrypted binary text
       decrypted_raw      RAW (2000);             -- stores decrypted binary text
       num_key_bytes      NUMBER := 256/8;        -- key length 256 bits (32 bytes)
       key_bytes_raw      RAW (32);               -- stores 256-bit encryption key
       encryption_type    PLS_INTEGER :=          -- total encryption type
                                DBMS_CRYPTO.ENCRYPT_AES256
                              + DBMS_CRYPTO.CHAIN_CBC
                              + DBMS_CRYPTO.PAD_PKCS5;
    begin
       DBMS_OUTPUT.PUT_LINE ('Original string: ' || input_string);
       DBMS_OUTPUT.PUT_LINE ('Encryption Type: ' || encryption_type);
       key_bytes_raw := DBMS_CRYPTO.RANDOMBYTES (num_key_bytes);
       DBMS_OUTPUT.PUT_LINE ('Key Bytes(RAW): ' || key_bytes_raw);
       encrypted_raw := DBMS_CRYPTO.ENCRYPT
             src => UTL_I18N.STRING_TO_RAW (input_string, 'AL32UTF8'),
             typ => encryption_type,
             key => key_bytes_raw
       DBMS_OUTPUT.PUT_LINE ('Encrypted string: ' || encrypted_raw);
        -- The encrypted value in the encrypted_raw variable can be used here
       decrypted_raw := DBMS_CRYPTO.DECRYPT
             src => encrypted_raw,
             typ => encryption_type,
             key => key_bytes_raw
       output_string := UTL_I18N.RAW_TO_CHAR (decrypted_raw, 'AL32UTF8');
       DBMS_OUTPUT.PUT_LINE ('Decrypted string: ' || output_string);
    end;
    32   33   34  /
    Original string: Secret Message
    Encryption Type: 4360
    Key Bytes(RAW): 52EC66508FDF1E5DE5FD38EC2467FAA91009B738A2926AA870E142C080C72EBF
    Encrypted string: 0BDDC2B94F7044700D85624297A39025
    Decrypted string: Secret Message
    PL/SQL procedure successfully completed.
    SQL> select length('52EC66508FDF1E5DE5FD38EC2467FAA91009B738A2926AA870E142C080C72EBF') from dual ;
    LENGTH('52EC66508FDF1E5DE5FD38EC2467FAA91009B738A2926AA870E142C080C72EBF')
                                                 64
    SQL> select dump('52EC66508FDF1E5DE5FD38EC2467FAA91009B738A2926AA870E142C080C72EBF') from dual ;
    DUMP('52EC66508FDF1E5DE5FD38EC2467FAA91009B738A2926AA870E142C080C72EBF')
    Typ=96 Len=64: 53,50,69,67,54,54,53,48,56,70,68,70,49,69,53,68,69,53,70,68,51,56,69,67,50,52,54,55,70,65,65,57,49,48,48,57,66,55,51,56,65,50,57,50,54,65,65,56,55,48,69,49,
    52,50,67,48,56,48,67,55,50,69,66,70Your example:
    declare
       input_string       VARCHAR2 (200) := 'SomeText';
       output_string      VARCHAR2 (200);
       encrypted_raw      RAW (2000);             -- stores encrypted binary text
       decrypted_raw      RAW (2000);             -- stores decrypted binary text
       key_bytes_raw      RAW (32);               -- stores 256-bit encryption key
       encryption_type    PLS_INTEGER;          -- total encryption type
    begin
       DBMS_OUTPUT.PUT_LINE ('Original string: ' || input_string);
       encryption_type :=   DBMS_CRYPTO.ENCRYPT_AES256 + DBMS_CRYPTO.CHAIN_CBC + DBMS_CRYPTO.PAD_PKCS5;
       key_bytes_raw := UTL_I18N.STRING_TO_RAW('eiccmkjd94jfgniw03ljkdlfutcnv3209kfjd67023jlclmxzlmc9543ykflseu6', 'AL32UTF8');
       DBMS_OUTPUT.PUT_LINE ('Key Bytes(RAW): ' || key_bytes_raw);
       encrypted_raw := DBMS_CRYPTO.ENCRYPT
             src => UTL_I18N.STRING_TO_RAW (input_string, 'AL32UTF8'),
             typ => encryption_type,
             key => key_bytes_raw
        -- The encrypted value in the encrypted_raw variable can be used here
       decrypted_raw := DBMS_CRYPTO.DECRYPT
             src => encrypted_raw,
             typ => encryption_type,
             key => key_bytes_raw
       output_string := UTL_I18N.RAW_TO_CHAR (decrypted_raw, 'AL32UTF8');
       DBMS_OUTPUT.PUT_LINE ('Decrypted string: ' || output_string);
    end;
    27   28   29   30  /
    Original string: SomeText
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: raw variable length too long
    ORA-06512: at line 12
    SQL> select length('eiccmkjd94jfgniw03ljkdlfutcnv3209kfjd67023jlclmxzlmc9543ykflseu6') from dual ;
    LENGTH('EICCMKJD94JFGNIW03LJKDLFUTCNV3209KFJD67023JLCLMXZLMC9543YKFLSEU6')
                                                 64
    SQL> select dump('eiccmkjd94jfgniw03ljkdlfutcnv3209kfjd67023jlclmxzlmc9543ykflseu6') from dual ;
    DUMP('EICCMKJD94JFGNIW03LJKDLFUTCNV3209KFJD67023JLCLMXZLMC9543YKFLSEU6')
    Typ=96 Len=64: 101,105,99,99,109,107,106,100,57,52,106,102,103,110,105,119,48,51,108,106,107,100,108,102,117,116,99,110,118,51,50,48,57,107,102,106,100,54,55,48,50,51,106,
    108,99,108,109,120,122,108,109,99,57,53,52,51,121,107,102,108,115,101,117,54

  • Counting a Special Character from a String

    Hello,
    I have a String let say 'ABC-X', 'ABC-X-Y' ....
    so how can we find the count/No. of Hypen('-') .. in a string....

    I have a String let say 'ABC-X', 'ABC-X-Y' ....
    so how can we find the count/No. of Hypen('-') .. in a string....
    SQL> var str varchar2(20);
    SQL> exec :str := 'ABC-X-Y';
    PL/SQL procedure successfully completed.
    SQL> select length(:str) - nvl(length(replace(:str,'-')),0) from dual;
    LENGTH(:STR)-NVL(LENGTH(REPLACE(:STR,'-')),0)
                                                2
    SQL>

  • Strip the first character from a string

    i am trying to strip the leftmost character from a string
    using the following:
    <cfset Charges.DTL_CHG_AMT_EDIT =
    #Right(Charges.DTL_CHG_AMT_EDIT,Len(Charges.DTL_CHG_AMT_EDIT)-1)#>
    i keep getting the following error:
    Parameter 2 of function Right which is now -1 must be a
    positive integer

    > RemoveChars() much easier than Right()? How so?
    Semantically, if the object of the exercise is to *REMOVE
    CHARacters from a
    string* (which it is, in this case), it is simply better
    coding to use
    removeChars() rather than right(). That, and it's one less
    function call
    (the RIGHT() solution also requires a call to LEN() for it to
    work).
    So removeChars() is "easier" because it reflects the intent
    of the exercise
    directly, is simpler logic, is easier to read, and - I can't
    be arsed
    counting keystrokes - is probably less typing.
    That'd be how.
    Adam

  • Detect special character from a String

    Hello guys,
    Some of the files in unix box contain special characters . I need to strip these special character in the filename to underscore. however, I do not want to strip off special character like _ - ^ . @
    Pattern escaper = Pattern.compile("([^a-zA-z0-9_-^.@])");
    I couldn't strip off the caret. Appreciate any advice please. Thanks in advance!
    Cheers,
    Mark

    Hi Alice,
    I tried your suggestion:
         public static void main(String[] args) throws IOException {
              rename(args[0], args[0].replaceAll("[^a-zA-Z0-9\\\\/:@._^-]","_"));
         public static void rename(String from, String to) throws IOException{
              // File (or directory) with old name
              File file1 = new File(from);
              // File (or directory) with new name
              File file2 = new File(to);
              // Rename file (or directory)
              boolean success = file1.renameTo(file2);
              if (!success) { // File was not successfully renamed
                   System.out.println("failed to rename : " + file1);
    C:\workspace\TestOnly\bin>java -cp . com.test.TestClass C:\Apps\mud\1~2.txt
    C:\workspace\TestOnly\bin>java -cp . com.test.TestClass C:\Apps\mud\1^2.txt
    failed to rename : C:\Apps\mud\12.txt
    C:\workspace\TestOnly\bin>java -cp . com.test.TestClass C:\Apps\mud\[email protected]
    C:\workspace\TestOnly\bin>java -cp . com.test.TestClass C:\Apps\mud\1@2$-_3mn.txt
    C:\workspace\TestOnly\bin>java -cp . com.test.TestClass C:\Apps\mud\1@2$-_3mn.txt
    failed to rename : C:\Apps\mud\1@2$-_3mn.txt
    C:\workspace\TestOnly\bin>java -cp . com.test.TestClass C:\Apps\mud\1@2$-_3m'n.txt
    C:\workspace\TestOnly\bin>java -cp . com.test.TestClass C:\Apps\mud\1@2$-_3m'^n.txt
    failed to rename : C:\Apps\mud\1@2$-_3m'n.txt
    C:\workspace\TestOnly\bin>java -cp . com.test.TestClass C:\Apps\mud\1@2$-_3m'^n.txtbut however, whenever I put in a caret in the filename, it always failed to rename. Appreciate your further advice please. thanks in advance!
    Cheers,
    Mark

  • How to replace a character in a string

    Hello Powerusers
    First i'me new in the applescripting so hope you can tell me a few hint to get on.
    I Have been trying to find a way to replace characters in a string using applescript. but with no luck
    Anybody having a script that can give me a clue on this.
    I'me normally programming in windows.... yeah i know there is a first time for everything.

    Okay i solved my problem but why arent the folder renamed?
    property oldfolder : ""
    property newfolder : ""
    property SS : "."
    property RS : " "
    to replaceText(someText, oldItem, newItem)
         replace all occurances of oldItem with newItem
              parameters -     someText [text]: the text containing the item(s) to change
                        oldItem [text, list of text]: the item to be replaced
                        newItem [text]: the item to replace with
              returns [text]:     the text with the item(s) replaced
              set {tempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, oldItem}
              try
                        set {itemList, AppleScript's text item delimiters} to {text items of someText, newItem}
                        set {someText, AppleScript's text item delimiters} to {itemList as text, tempTID}
              on error errorMessage number errorNumber -- oops
                        set AppleScript's text item delimiters to tempTID
                        error errorMessage number errorNumber -- pass it on
              end try
              return someText
    end replaceText
    tell application "Finder"
              set these_items to the selection
    end tell
    repeat with i from 1 to the count of these_items
              set this_item to (item i of these_items) as alias
              set this_info to info for this_item
              set oldfolder to name of this_info
              set newfolder to replaceText(oldfolder, SS, RS)
              set name of this_info to newfolder
    end repeat

  • Insert Tab character in a string

    I'm trying to create a string that will eventually be written
    to a text file that has to be tab delimited. I can't figure out how
    to insert a tab in the string. Here's an example:
    <cfset headerline = 'H' & TAB &
    #FORM.order_ID#>
    Obviously, 'TAB' doesn't work here. Help?
    Michelle

    michellezee@comcast. wrote:
    > I'm trying to create a string that will eventually be
    written to a text file
    > that has to be tab delimited. I can't figure out how to
    insert a tab in the
    > string. Here's an example:
    >
    > <cfset headerline = 'H' & TAB &
    #FORM.order_ID#>
    >
    > Obviously, 'TAB' doesn't work here. Help?
    >
    > Michelle
    >
    >
    TAB = #chr(9)#
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com

  • Replace charcter from string in 46c

    Hi,
    If you could send me code for below scanerio that will be great.
    in 46c i have string '/ABCD/te_12' now i want to replace the '/' with '+'  and '_' with '|', can you tell me how to do this.
    thanks,
    john

    hi check the replace statement... hit F1 on replace and make ur code..
    Basic form
    REPLACE f WITH g INTO h.
    Addition
    ... LENGTH len (length specification for field f )
    Effect
    Replaces the first occurrence of the contents of field f in field h with the contents of field g . All fields are handled in their defined length; this means that closing blanks are not ignored.
    The return code value indicates whether the string f was found in h and replaced by g :
    SY-SUBRC = 0 String replaced.
    SY_SUBRC = 4 String not replaced.
    Example
        DATA FIELD(10).
        MOVE 'ABCB' TO FIELD.
        REPLACE 'B' WITH 'string' INTO FIELD.
    returns:
    FIELD = 'AstringCB', SY-SUBRC = 0
    Note
    The fields f and g in the REPLACE statement should not overlap. Otherwise, the result is undefined.
    Addition
    ... LENGTH len ... (length specification for field f )
    Effect
    Searches for the string f in the field h not in its (full) field length, but in the length len .
    Example
        DATA: PATTERN(5) VALUE 'ABC',
              LEN TYPE I,
              REPL_STRING(5) VALUE '12345',
              FIELD(12) VALUE 'abcdeABCDE'.
        REPLACE PATTERN WITH REPL_STRING
                        INTO FIELD.
    does not change FIELD , since 'ABC ' does not occur in abcdeABCDE ' .
        LEN = STRLEN( PATTERN ).
        REPLACE PATTERN LENGTH LEN
                        WITH REPL_STRING
                        INTO FIELD.

Maybe you are looking for