Multiple substitutions of characters in string

Hi everybody....
Imagine that in a table column there are rows such as :
Xxxxxx
YYYYY
My purpose is to find a substring in an .xml file which resembles on particular column row....
For example if i have the row value 'Xxxxxx' then i want to search and replace in each line in .xml file which have ....
'Xxxxxx' , or 'XXXXXX' , or .... -- same number of characters but maybe different ascii characters (lower , upper , mix-case). Is this possible ?
Thanks ,a lot
Simon

Hi ,
thanks for your reply...
I convert the forms (in Developer Suite 10g) into .xml using the frmf2xml.bat file in order to change the path and name of forms to lowercase only - they are mixed-case.
Now, i have the path and form names in a table....
Selecting this path and form names i try to find the substring in this .xml file in order to change the .xml file appropriately - according to the selected path and form names...
For example ,
if the column name ' path ' has the value 'admin' and the column name 'form_name' has the value 'test' ..
I want to search in the .xml file instances of :
admin\test,
Admin\Test,
Admin\test,
admin\TEST , e.t.c. - possibly all combinations ...
How can i do it as simpler as possible.....???
I don't want to get complicated in XMLDB....XMLTYPE ,e.t.c..
I use the .xml file as a simple .txt file....
Thanks , a lot for your reply...
Simon

Similar Messages

  • Regex replacing multiple characters in string.

    I have been working through the Java regex tutorial and tried to modify one of the programs for my own use. Basically, I want to take a string and convert the chatracters A to T, T to A, C to G and G-C.
    I produced the rather crude program below, but of course it doesn't work. A could be converted to T and back again before the program terminates.
    I know that the code to do this correctly is probably quite complex, so could anyone point me in the direction of a tutorial which will help me to do this?
    This aside, I take it that if I am looking for multiple matches of characters which won't give the problem already indicated above, my code is too bloated anyway. Say, for example, instead of wanting to replace A to T, T to A, C to G and G-C, I wanted to replace dog-cat, horse-donkey - lion, tiger , cat-mouse. My code will work for this, but I am sure that it could be compressed a lot. Surely I would not need all the lines of code to do this?
    Thanks for any help,
    Tim
    import java.util.regex.Pattern;
    import java.util.regex.Matcher;
    import java.io.*;  // needed for BufferedReader, InputStreamReader, etc.
        /** A Java program that demonstrates console based input and output. */
         class dna {
            // Create a single shared BufferedReader for keyboard input
            private static BufferedReader stdin =
                new BufferedReader( new InputStreamReader( System.in ) );
            // Program execution starts here
            public static void main ( String [] args ) throws IOException
                // Prompt the user
                System.out.print( "Type your DNA sequence: " );
                // Read a line of text from the user.
                String DNA = stdin.readLine();
                DNA = DNA.toUpperCase();
                String DNA2 = DNA;
                //calculate reverse complement
                Pattern A = Pattern.compile("A");
                Pattern T = Pattern.compile("T");
                Pattern C = Pattern.compile("C");
                Pattern G = Pattern.compile("G");
                Matcher AA = A.matcher(DNA);
                DNA = AA.replaceAll("T");
                Matcher TT = T.matcher(DNA);
                DNA = TT.replaceAll("A");
                Matcher CC = C.matcher(DNA);
                DNA = CC.replaceAll("G");
                Matcher GG = G.matcher(DNA);
                DNA = GG.replaceAll("C");
                // Display the input back to the user.
                System.out.println( "DNA input             : " + DNA2);
                System.out.println ("Complementary sequence: " + DNA);
        }

    TimM wrote:
    Thanks a lot!!! Can't believe you managed all that with so few lines of code.You're welcome.
    Must be great to know what you are doing :-)
    Thanks again,
    TimAfter being a bit more familiarised with the methods of String, you'll be able to do this in no time, I'm sure!

  • Replacing multiple new line characters

    how to replace multiple new line characters in a line.
    Suppose for example my line contains Example1#####Example2##Example3###Example4,
    then the output should be Example1#Example2#Example3#Example4.

    Hi Sid,
    You Can try this code
    DATA: ld_string TYPE string,
          ld_string1 TYPE string,
          ld_string2 TYPE string,
          ld_string3 TYPE string.
    ld_string = 'Example1#####Example2##Example3###Example4'.
    REPLACE ALL OCCURRENCES OF '######' in ld_string with '#'.
    REPLACE ALL OCCURRENCES OF '####' in ld_string with '#'.
    REPLACE ALL OCCURRENCES OF '###' in ld_string with '#'.
    REPLACE ALL OCCURRENCES OF '##' in ld_string with '#'.
    write:/1 ld_string.
    Regards
    Pavan

  • Characters in String : Unicode 16-bit to custom 32-bit

    I understand that internally in Java, characters in Strings are actually Unicode characters, with each character represented with 16 bits.
    So, character �L� in Unicode is 0x004C
    which is also 0000 0000 0100 1100
    Now, I wish to encode each of the 4 bits above into individual ASCII characters:
    = 0 0 4 C
    = 0x30 0x30 0x34 0x43
    = 00110000 00110000 00110100 01000011
    So, from the original 16-bit character in Java, I want a final 32-bit.
    Eventually, I�ll need to send the final result over the network, via OutputStream/writer and socket.
    Can someone help me on this ? Or give me some ideas... Thanks.

    trick: prepend the number with 1 and use substring... like int charWith1 = c + 0x10000. That'll make charWith1 to be of the format 0x1XXXX. Then call hexstring on that, you get a string like "1XXXX." Then you can drop the 1 with a call to substring.
    of course there are methods that use only bit operations and additions to do it, making it a bit faster.. like this:
    byte byte0 = (byte) ((c & 0x000F) + '0');
    byte byte1 = (byte) (((c & 0x00F0) >> 4) + '0');
    ...

  • Removing non-numeric characters from string

    Hi there,
    I need to have the ability to remove non-numeric characters from a string and I do not know how to do this.
    Does any one know a way?
    Example:
    Present String: (02)-2345-4607
    Required String: 0223454607
    Thanks in advance

    Dear NickM
    Try this this will work...........
    create or replace function char2num(mstring in varchar2) return integer
    is
    -- Function to remove Special characters and alphebets from phone no. string field
    -- Author - Valid Bharde.(India-Mumbai)
    -- Date :- 20 Sept 2006.
    -- This Function will return numeric representation.
    -- The Folowing program is gifted to NickM with respect to his post on oracle site regarding Removing non-numeric characters from string on the said date
    mstatus number :=0;
    mnum number:=0;
    mrefstring varchar2(50);
    begin
    mnum := length(mstring);
    for x in 1..mnum loop
    if (ASCII(substr(upper(mstring),x,1)) >= 48 and ASCII(substr(upper(mstring),x,1)) <= 57) then
    mrefstring := mrefstring || substr(mstring,x,1);
    end if;
    end loop;
    return mrefstring;
    end;
    copy the above program and use it at function for example
    SQL> select char2num('(022)-453452781') from dual;
    CHAR2NUM('(022)-453452781')
    22453452781
    Chao!!!

  • Number of repeated characters in string array

    Hi,
    I m trying to get number of repeated characters in string array. I couldnt figure out where am i doing mistake.
    thank you,
    For example: count({"alpha, beta,"}, 'a')
    a is repeated 3
    l is repeated 1 etc.
    public class Test
    public static int count(String[] stringArray, char c)
    public String [] str = new String [2];
    int count = 0;
    str[0]
    str[1]
    for(int i = 0; i<str.length(); i++)
    if (str.charAt(i)
    count++;
    return count;

    There is a difference between a String and a String [].
    A String [] is an array of String class objects:/*  Traverse_Array_Of_Strings_1.java */
    public class Traverse_Array_Of_Strings_1
      public static void main(String [] argv)
        /* here is an array of Strings */
        String [] s = { "hello", "how", "are", "you" };
        int i, j;
        System.out.println("s.length = "+ s.length );
        for (i= 0; i < s.length; i++)
          System.out.println("s= <"+ s[i] +">");
          for (j= 0; j < s.length(); j++)
    System.out.print(s[i].charAt(j) +", ");
    System.out.println("\n-----");
    }output:java> javac Traverse_Array_Of_Strings_1.java
    java> java Traverse_Array_Of_Strings_1
    s.length = 4
    s= <hello>
    h, e, l, l, o,
    s= <how>
    h, o, w,
    s= <are>
    a, r, e,
    s= <you>
    y, o, u,
    Edited by: vim_no1 on Jul 15, 2010 7:43 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Multiple substitution for a GL account

    Hi all,
    The requirement is to substitute a GL account with two different GL accounts, there by when settelment happens through CJ88 it shud affect to these new accounts. We are trying to do using substitutions. Can anyone guide me how to do (multiple substitutions) using this? or any other suitable way for this...?
    Its urgent..Plz help.
    Thanks,
    Balaji

    Hi,
    I thought so, when i have created a new validation and try to assign to the company code in GGB4 it says object already exist as the company code got one validatation assigned to it.
    When i am trying to assign my new validation it is not getting assigned.
    Can you please help me.
    Thanks

  • How to make Multiple parameters to sql query string seperated by ,(comma) ..

    Hi,
    I would like to konw how I can make multiple parameters to sql query string seperated by ,(comma)  ..
    For example, this parameters can be printed like 'abc,dde,ggf,eeg' ,once I use  "join(Parameters!rpCode.Value,",")" with report builder , 
    By the way, when I test this multiple parameters by Query Designer of report builder there was no problem,.(using Define query parameters, I put abc,dde,ggf,eeg)
    however, when I run this report , it won't be executing ,  with (rsErrorExecutingCommand)
    Plz, help me....

    If its sql query then it should like this
    Select t.*
    from table t
    inner join dbo.ParseValues(@Parameters,',')f
    on f.val = t.ID
    ParseValues can be found him
    http://visakhm.blogspot.in/2010/02/parsing-delimited-string.html
    or easier way is
    Select t.*
    from table t
    where ',' + @Parameters + ',' LIKE '%,' + CAST(t.ID AS varchar(10)) + ',%'
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to maintain Multiple Substitution (2003) Infotype

    Folks,
    I need to maintain multiple substitution for an employee on same date.
    _Example:_
        Employee planned working time ( Infotype 0007 ) - Shift A ( 6 AM to 2 PM )
        But he has come in Substitution Shift B ( 2 PM to 10 PM ) instead of Shift A.
        Due to month end work , his senior manager may say him to continue Shift C also.
        ( It happens in Manufacturing industries )
       Now i need to maintain both Shift substitution in 2003 infotype.
       But system doesn't allows me to enter two Substituion for same date.
       Is there any solution for . If Yes , say me procedure.
       Answers will be rewarded.
    Regards
    Surendar

    No No, I am just asking you to make a decision based on your requiremnts and how your system is set up.
    Entering a DWS OR star time and end time in IT 2003 will replace the planned working time in IT 0007. (Dont enter both at the same time)
    So if you maintain the following times 0600 to 2200 in IT 2003, then the employee has a planned working time for 16 hrs, he does not get any benefit for working 8 extra hours. Is this the way you want system to work?
    Normally under such circumstance, the employee will get compensated in some way for working extra hours. If this is how system should work, you should only enter 0600-1400 ( or whatever SHIFT B timing is ) in IT 2003 and enter the extra shift (Shift C) worked as Overtime.
    I hope the above clarifies my answer.
    Please note that wiothout knowing exactly how your system is set up, we cannot give you an exact answer through the internet, We can give pointers and guidelines, which you need to analyse yourself in light of your own system design. If you have any doubt, enter the data in test system and try it out and see if the payment is made correctly as expected,.

  • (261718088) Q: Can you use xm:multiple with Objects other than String?

    Q: Can you use xm:multiple with Objects other than Strings?
    <br>
    A: You bet. Attached find a text file with some code from the example I showed
    today, a version of the multipleSayHiTo() method that has a parameter of an Array
    of Person objects rather than a parameter of an Array of Strings. The code within
    the text file comes from the Greeting.jws file (the Greeting Web Service).
    [multiple.txt]

    So you are saying that the recovery discs I made do include the copy of windows that was originally installed?
    Absolutely! They will restore the hard disk to its original out-of-the-box contents. Follow the instructions in the section Restoring from recovery DVDs/media, which begins on p. 73 of the User's Guide.
       Satellite A660 Series User’s Guide
    maybe i can make a deal with wd to have them swap this drive out for the BEKT instead...
    That would be a good idea in any case.
    As I said, the 10-fc12-045d error would not be due to the drive's being AFT, but more likely the discs are not being read properly. New discs can be obtained from Toshiba. Scroll down to Get Recovery Media here
    -Jerry

  • Replace special characters in String

    Dear Guru ,
    Does SAP provide the standard function that can replace the special characters in String ?
    For example :
    I have one template string : " & & & & & output(s) have not been processed yet ! " and five parameters : "P1" , "P2" , "P3" , "P4" , "P5" .
    And i would like to apply all parameters into the string to replace the "&" character . Is it possibile ?
    My idea is sourcing from the Message String that in tcode : SE91 .
    Thanks .
    Best Regards,
    Carlos Zhang

    Hi Carlos,
    I think instead of a standard FM you can write a one line command to do this job.
    E.g. 
    constant: str1 type string value 'output(s) have not been processed yet ! '.
    data: var1 type c,
             var2 type c,
             var3 type c,
             var4 type c,
             str    type string.
    concatenate var1 var2 var3 var4 str1 into str separated by space.
    So str will have the final value.
    Thanks,
    Mainak

  • Is there a way in Oracle to return multiple rows as a single string?

    Hi gurus,
    I just got help from your guys fixing my dynamic sql problem. What I am doing in that function is to return a single string from multiple rows and I use it in the select statement. It works fine once the problem was solved. But is there any way in Oracle to do this in the select statement only? I have a table that stores incidents (incident_id is the PK) and another table that stores the people that are involved in an incident.
    Incident_table
    (incident_id number PK);
    Incident_people_table
    (incident_id number PK/FK,
    person_id number PK);
    Now in a report, I need to return the multiple rows of the Incident_People_table as a single string separated by a comma, for example, 'Ben, John, Mark'. I asked the SQL Server DBA about this and he told me he can do that in SQL Server by using a variable in the sql statement and SQL Server will auomatically iterate the rows and concatenate the result (I have not seen his actual work). Is there a similar way in Oracle? I have seen some examples here for some similar requests using the sys_connect_by_path, but I wonder if it is feasible in a report sql that is already rather complex. Or should I just stick to my simpler funcion?
    Thanks.
    Ben

    Hi,
    May be, this example will help you.
    SQL> CREATE TABLE Incident_Table(
      2    incident_id number
      3  );
    Table created.
    SQL> CREATE TABLE Person_Table(
      2    person_id number,
      3    person_name VARCHAR2(200)
      4  );
    Table created.
    SQL> CREATE TABLE Incident_People_Table(
      2    incident_id number,
      3    person_id number
      4  );
    Table created.
    SQL> SELECT * FROM Incident_Table;
    INCIDENT_ID
              1
              2
    SQL> SELECT * FROM Person_Table;
    PERSON_ID PERSON_NAME
             1 John
             2 Mark
             3 Ben
             4 Sam
    SQL> SELECT * FROM Incident_People_Table;
    INCIDENT_ID  PERSON_ID
              1          1
              1          2
              1          3
              2          1
              2          2
              2          4
    6 rows selected.
    SQL> SELECT IT.*,
      2    (
      3      WITH People_Order AS (
      4        SELECT IPT.incident_id, person_id, PT.person_name,
      5          ROW_NUMBER() OVER (PARTITION BY IPT.incident_id ORDER BY PT.person_name) AS Order_Num,
      6          COUNT(*) OVER (PARTITION BY IPT.incident_id) AS incident_people_cnt
      7        FROM Incident_People_Table IPT
      8          JOIN Person_Table PT USING(person_id)
      9      )
    10      SELECT SUBSTR(SYS_CONNECT_BY_PATH(PO.person_name, ', '), 3) AS incident_people_list
    11      FROM (SELECT * FROM People_Order PO WHERE PO.incident_id = IT.incident_id) PO
    12      WHERE PO.incident_people_cnt = LEVEL
    13      START WITH PO.Order_Num = 1
    14      CONNECT BY PRIOR PO.Order_Num = PO.Order_Num - 1
    15    ) AS incident_people_list
    16  FROM Incident_Table IT
    17  ;
    INCIDENT_ID INCIDENT_PEOPLE_LIST
              1 Ben, John, Mark
              2 John, Mark, SamRegards,
    Dima

  • Convert integers to equivalent characters in string - NOT ASCII code character

    I have to output my data and associated string information to a string array and then to a spreadsheet file.
    I want to do this by converting integers (and other numbers) to an identical string of characters.
    I have tried Type Cast with a string constant as the type input but it DOES NOT WORK.  Instead, I get the ASCII character whose numerical designation matches the integer, e.g. integer "50" become capital "P".
    I want integer "50" to be string "50".
    Please advise and no, I do not want to make arrays of clusters.
    Solved!
    Go to Solution.

    I found my answer but only after searching for "Number" conversion rather than "Integer" conversions.
    In the Programming palette  - String Functions - String/Number Conversion - Number to Decimal String:
    "Converts number to a string of decimal digits at least width characters wide or wider if necessary. If number is floating-point, it is rounded to a 64-bit integer before conversion."

  • How to Avoid Special Characters in string

    Hai.
    I want only Alphabets & Digits to be entered in to my string.No any other special characters except spaces.How can I do this? 
    Solved!
    Go to Solution.

    MikeS81 wrote:
    see the attached example.
    I would allow a few more, e.g. 0 and 8 to allow editing of the entered string (backspace, cursor buttons, delete key, etc.).
    Message Edited by altenbach on 11-21-2008 12:49 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    check_char_LV80MOD.vi ‏14 KB
    FilterStringInput.gif ‏6 KB

  • How to replace special characters in string.

    Hello,
    I want to replace special characters such as , or ; with any other character or " ".I find out there is no such function is java for this.There is only replace() but it accepts only chars.If anybody know how to do this?.
    Thanks,

    Hello,
    I want to replace special characters such as , or ;
    with any other character or " ".I find out there is no
    such function is java for this.There is only replace()
    but it accepts only chars.If anybody know how to do
    this?.
    Thanks,Can't you just do the following?
    public class Test
         public static void main(String[] args)
         String testString = "Hi, there?";
         System.out.println(testString.replace(',',' '));
    }

Maybe you are looking for

  • Problem in String reading

    I'm trying to read �r�nler aras�nda k�yaslama yapmak i�in se�iniz what i get is �?r��nler aras��nda k��yaslama yapmak i��in se��iniz I am using String class to read it using URL class from a turkish website using the following code String pagedata=""

  • Data updation in BI

    hi, i have developed a repository after developing cube n dimensions in oracle warehouse builder. Now, i have developed few graphs and pivot tables in bi answers and presented them on BI dashboard. My reports on dashboard contains employees strength

  • Motion Judder in MAC 10,1,85,3

    Hello. I was attempting to watch the LIVE F1 Grand Prix feed from the BBC and the player was jumping around like it was cooking popcorn Audio was fine but the picture was unwatchable. When I went back to the site the video ran for a little while (a r

  • Parsing escape characters

    I have a query: //query String query_one = "UPDATE homepage SET section1='" + section1 + "' "; //execute query section1SQL.executeUpdate(query_one); Here's the problem: if the var + section1 + contains a single quote or an apostrophe - the SQL query

  • Which is better : iphone 5s or galaxy s4 ?

    Plaease answer