Char to string

I can't seem to figure this out and maybe it's not possible but what im trying to do is make an array or the symbols like !@#$% and letters abcd... so I'm trying to just use the ASCII char codes... so i do (char)33 which is "!" and store it into an array but i want to make them strings so i can use replaceAll with another string

Apple
char is a primitive, not an Object, and primitives don't have methods. If this is how you want to do it, you should be looking at the class Character, or the constructors for String.
This is just one of the many ways to get what you need:        String[] keys = new String[16];
        for(int i = 0; i < 16; i++ )
            Character tempChar = new Character((char) (i + 32));
            keys[i] = tempChar.toString();
        for (int i=0; i < keys.length; i++)
            System.out.println(keys);
}Please take care in future to ask any question in a way that is easily understood.
db

Similar Messages

  • Replace char on String

    Hi All,
    String strValue = "ABC TPT 0694";
    My String is as shown above, I am looking for a way to replace char at byte 6 (position 6) with another Char in String.
    For example at location 6 it is "T" I want to replace it with char "O". can any one tell me how to do this

    String strValue = "ABC TPT 0694";
    char[] chars = strValue.toCharArray();
    chars[5] = 'O';
    strValue = String.valueOf(chars);

  • What api would I use to get the number of chars in string?

    What api would I use to get the number of chars in string?

    Assuming that you really mean that you want the number of charaters in a String (not string), that would be documented in java.lang.String
    The method is length()

  • ASCII character/string processing and performance - char[] versus String?

    Hello everyone
    I am relative novice to Java, I have procedural C programming background.
    I am reading many very large (many GB) comma/double-quote separated ASCII CSV text files and performing various kinds of pre-processing on them, prior to loading into the database.
    I am using Java7 (the latest) and using NIO.2.
    The IO performance is fine.
    My question is regarding performance of using char[i] arrays versus Strings and StringBuilder classes using charAt() methods.
    I read a file, one line/record at a time and then I process it. The regex is not an option (too slow and can not handle all cases I need to cover).
    I noticed that accessing a single character of a given String (or StringBuilder too) class using String.charAt(i) methods is several times (5 times+?) slower than referring to a char of an array with index.
    My question: is this correct observation re charAt() versus char[i] performance difference or am I doing something wrong in case of a String class?
    What is the best way (performance) to process character strings inside Java if I need to process them one character at a time ?
    Is there another approach that I should consider?
    Many thanks in advance

    >
    Once I took that String.length() method out of the 'for loop' and used integer length local variable, as you have in your code, the performance is very close between array of char and String charAt() approaches.
    >
    You are still worrying about something that is irrevelant in the greater scheme of things.
    It doesn't matter how fast the CPU processing of the data is if it is faster than you can write the data to the sink. The process is:
    1. read data into memory
    2. manipulate that data
    3. write data to a sink (database, file, network)
    The reading and writing of the data are going to be tens of thousands of times slower than any CPU you will be using. That read/write part of the process is the limiting factor of your throughput; not the CPU manipulation of step #2.
    Step #2 can only go as fast as steps #1 and #3 permit.
    Like I said above:
    >
    The best 'file to database' performance you could hope to achieve would be loading simple, 'known to be clean', record of a file into ONE table column defined, perhaps, as VARCHAR2(1000); that is, with NO processing of the record at all to determine column boundaries.
    That performance would be the standard you would measure all others against and would typically be in the hundreds of thousands or millions of records per minute.
    What you would find is that you can perform one heck of a lot of processing on each record without slowing that 'read and load' process down at all.
    >
    Regardless of the sink (DB, file, network) when you are designing data transport services you need to identify the 'slowest' parts. Those are the 'weak links' in the data chain. Once you have identified and tuned those parts the performance of any other step merely needs to be 'slightly' better to avoid becoming a bottleneck.
    That CPU part for step #2 is only rarely, if every the problem. Don't even consider it for specialized tuning until you demonstrate that it is needed.
    Besides, if your code is properly designed and modularized you should be able to 'plug n play' different parse and transform components after the framework is complete and in the performance test stage.
    >
    The only thing that is fixed is that all input files are ASCII (not Unicode) characters in range of 'space' to '~' (decimal 32-126) or common control characters like CR,LF,etc.
    >
    Then you could use byte arrays and byte processing to determine the record boundaries even if you then use String processing for the rest of the manipulation.
    That is what my framework does. You define the character set of the file and a 'set' of allowable record delimiters as Strings in that character set. There can be multiple possible record delimiters and each one can be multi-character (e.g. you can use 'XyZ' if you want.
    The delimiter set is converted to byte arrays and the file is read using RandomAccessFile and double-buffering and a multiple mark/reset functionality. The buffers are then searched for one of the delimiter byte arrays and the location of the delimiter is saved. The resulting byte array is then saved as a 'physical record'.
    Those 'physical records' are then processed to create 'logical records'. The distinction is due to possible embedded record delimiters as you mentioned. One logical record might appear as two physical records if a field has an embedded record delimiter. That is resolved easily since each logical record in the file MUST have the same number of fields.
    So a record with an embedded delimiter will have few fields than required meaning it needs to be combined with one, or more of the following records.
    >
    My files have no metadata, some are comma delimited and some comma and double quote delimited together, to protect the embedded commas inside columns.
    >
    I didn't mean the files themselves needed to contain metadata. I just meant that YOU need to know what metadata to use. For example you need to know that there should ultimately be 10 fields for each record. The file itself may have fewer physical fields due to TRAILING NULLCOS whereby all consecutive NULL fields at the of a record do not need to be present.
    >
    The number of columns in a file is variable and each line in any one file can have a different number of columns. Ragged columns.
    There may be repeated null columns in any like ,,, or "","","" or any combination of the above.
    There may also be spaces between delimiters.
    The files may be UNIX/Linux terminated or Windows Server terminated (CR/LF or CR or LF).
    >
    All of those are basic requirements and none of them present any real issue or problem.
    >
    To make it even harder, there may be embedded LF characters inside the double quoted columns too, which need to be caught and weeded out.
    >
    That only makes it 'harder' in the sense that virtually NONE of the standard software available for processing delimited files take that into account. There have been some attempts (you can find them on the net) for using various 'escaping' techniques to escape those characters where they occur but none of them ever caught on and I have never found any in widespread use.
    The main reason for that is that the software used to create the files to begin with isn't written to ADD the escape characters but is written on the assumption that they won't be needed.
    That read/write for 'escaped' files has to be done in pairs. You need a writer that can write escapes and a matching reader to read them.
    Even the latest version of Informatica and DataStage cannot export a simple one column table that contains an embedded record delimiter and read it back properly. Those tools simply have NO functionality to let you even TRY to detect that embedded delimiters exist let alone do any about it by escaping those characters. I gave up back in the '90s trying to convince the Informatica folk to add that functionality to their tool. It would be simple to do.
    >
    Some numeric columns will also need processing to handle currency signs and numeric formats that are not valid for the database inpu.
    It does not feel like a job for RegEx (I want to be able to maintain the code and complex Regex is often 'write-only' code that a 9200bpm modem would be proud of!) and I don't think PL/SQL will be any faster or easier than Java for this sort of character based work.
    >
    Actually for 'validating' that a string of characters conforms (or not) to a particular format is an excellent application of regular expressions. Though, as you suggest, the actual parsing of a valid string to extract the data is not well-suited for RegEx. That is more appropriate for a custom format class that implements the proper business rules.
    You are correct that PL/SQL is NOT the language to use for such string parsing. However, Oracle does support Java stored procedures so that could be done in the database. I would only recommend pursuing that approach if you were already needing to perform some substantial data validation or processing the DB to begin with.
    >
    I have no control over format of the incoming files, they are coming from all sorts of legacy systems, many from IBM mainframes or AS/400 series, for example. Others from Solaris and Windows.
    >
    Not a problem. You just need to know what the format is so you can parse it properly.
    >
    Some files will be small, some many GB in size.
    >
    Not really relevant except as it relates to the need to SINK the data at some point. The larger the amount of SOURCE data the sooner you need to SINK it to make room for the rest.
    Unfortunately, the very nature of delimited data with varying record lengths and possible embedded delimiters means that you can't really chunk the file to support parallel read operations effectively.
    You need to focus on designing the proper architecture to create a modular framework of readers, writers, parsers, formatters, etc. Your concern with details about String versus Array are way premature at best.
    My framework has been doing what you are proposing and has been in use for over 20 years by three different major nternational clients. I have never had any issues with the level of detail you have asked about in this thread.
    Throughout is limited by the performance of the SOURCE and the SINK. The processing in-between has NEVER been an issu.
    A modular framework allows you to fine-tune or even replace a component at any time with just 'plug n play'. That is what Interfaces are all about. Any code you write for a parser should be based on an interface contract. That allows you to write the initial code using the simplest possible method and then later if, and ONLY if, that particular module becomes a bottlenect, replace that module with one that is more performant.
    Your intital code should ONLY use standard well-established constructs until there is a demonstrated need for something else. For your use case that means String processing, not byte arrays (except for detecting record boundaries).

  • Delete a char from string ?

    Hi,
    I want to delete a char from string. i used the following function.
    String f = formulla.replace('[','');
    The above function doesnt work as it tells me to put a space or some char in 2nd parameter which i dont want. i just want to delete all occurences of some specific char in a string.
    Any suggestion.
    Thanks alot.

    u can do:
    String before;
    char charToReplace;
    StringBuffer tempBuf = new StringBuffer(before);
    for (int i=0; i<tempBuf.length(); i++)
            if (tempBuf.charAt(i)==charToReplace)
                  tempBuf.deleteCharAt(i);
    String after = tempBuf .toString(); HTH
    Yonatan

  • I have to generate a 4 char unique string from a long value

    I got a requirment
    I have to generate a 4 char unique string from a long value
    Eeach char can be any of 32 character defined has below.
    private static final char char_map[] = new char[]{'7','2','6','9','5','3','4','8','X','M','G','D','A','E','B','F','C','Q','J','Y','H','U','W','V','S','K','R','L','N','P','Z','T'};
    So for 4 char string the possible combination can be 32 * 32 * 32 * 32 = 1048576
    If any one passes a long value between 0 - 1048576 , it should generate a unique 4 char string.
    Any one with idea will be a great help.

    Well, a long is 64 bits. A char is 16 bits. Once you determine how you want to map the long's bits to your char bits, go google for "java bitwise operators".

  • Converting chars to strings

    I don't know how to get this thing to work:
    public class TestGrade
    public static void main(String[] args)throws GradeException
      int studentID = 123423;
      char grade;
      String aGrade = new String();
      try
       System.out.println("Student #: " + studentID);
       System.out.println("Enter a letter grade for student: ");
       grade = (char)System.in.read();
       if(grade >= 'A' && grade <= 'F' || grade >= 'f' && grade <= 'f')
        System.out.println("Student ID#: " + studentID + "Grade: " + grade);
        aGrade = grade;
       else
        throw(new GradeException(aGrade));
      catch(GradeException error)
           System.out.println("Test Error: " + error.getMessage ());
    }

    it might help if I tell you where the error is...
       aGrade = grade; generates a rather obvious error. Incompatible types, I don't know how to convert this sucker into a string so I can feed a string into GradeException....

  • Get chars from string of numerals

    here is what I would like to accomplish:
    Put the last four integers of the systemDate into a variable so I can do some math with them.
    Thanks.

    Excellent.  Thank you for the info.  Very helpful.
    Dewey
    From: jchunick [email protected]
    Sent: Friday, June 03, 2011 4:20 PM
    To: Dewey Parker
    Subject: Re: get chars from string of numerals
    This is a post I made for the wiki which should help: http://director-online.com/dougwiki/index.php?title=Undocumented_Lingo#the_systemDate

  • Convert char[] to string

    Hi,
    How can I convert a char array to string?

    Don't worry about it.
    Just I have to use String(char[])
    Thanks :)

  • How can i convert a char[] to String?

    Hi all!,
    What would be the easiest way to convert a char[] to a String? Im trying to set the text of a JTextArea which takes a String as an arguement but i have a character arry that if filled from a FileReader. Any suggestions?
    Thanks.

    The easiest way would be new String(charArray). There's a version of the constructor in the String class that take a char array

  • Validating Char. & Strings

    Hello,
    I am a novice programmer and my program does not check for strings and numeric characters. Below is my program, please give me some feedback, as soon as possible. Thanks a lot
    Martin
    import javax.swing.JOptionPane;
    import java.text.DecimalFormat;
    public class GradeWatch6{//start of class definition GradeWatch
         public static void main ( String args[] ) {//start of main method
              //string declarations
              String firstname="";
              String secondname;
              String studentid;
              String midtermgrade;
              String finalgrade;
              String listings="";
              String option;//variable used to receive user's option <-1>//<0>
              //character declarations
              char actualgrade;//letter grade assigned to total points earned
              char lettergrade=0;//assignment of a letter grade
              //integer declarations
              int loop=0;//(this will be converted fr. option//will compare result)
              int studentid_int;
              int midterm_grade=0;
              int final_grade=0;
              double midterm_gradevalue=0;//point calculations
              double final_gradevalue=0;//point calculations
              double total_gradevalue=0;//total points possible out of 100
              do
              //input dialogs (5)
              boolean firstnamecheck=true;
              while (firstnamecheck=false){
              firstname = JOptionPane.showInputDialog("Enter The Student's First Name: ");
              if (!Character.isLetter(firstname.charAt(0)))
                   firstnamecheck=false;
              for (int j=1;j<firstname.length();j++)
                   if (!Character.isDigit(firstname.charAt(j)))
                             firstnamecheck=false;
                             System.out.println(""+firstnamecheck);//printing on black screen
                             secondname= JOptionPane.showInputDialog ( "Invalid Entry!" );
              secondname = JOptionPane.showInputDialog("Enter The Student's Last Name: ");
              studentid = JOptionPane.showInputDialog("Student Id is the Student's Social Security Number.\nEnter The Student's ID #: ");
              studentid_int= Integer.parseInt(studentid);
              /*Validates student id so that it can only receive a 9 digit number,
              no negative values, and only alows integer input/
              while ( (studentid.length()!=9) ||(studentid_int<0) )
                        studentid= JOptionPane.showInputDialog ( "Invalid Entry! \n Student Id is the Student's Social Security Number.\nPlease Re-Enter Student Id: ");
                        studentid_int= Integer.parseInt(studentid);
              midtermgrade = JOptionPane.showInputDialog("This is worth 40% of Student's Grade.\nEnter Mid-term Grade: ");
              midterm_grade = Integer.parseInt( midtermgrade);
              while ( (midterm_grade < 0) || (midterm_grade > 100) )
                        midtermgrade=JOptionPane.showInputDialog ("Invalid Entry!\nA grade entered must be between (0-100).\nPleae Re-Enter Mid-term Grade: ");
                        midterm_grade = Integer.parseInt( midtermgrade);
              finalgrade = JOptionPane.showInputDialog("This is worth 60% of Student's Grade.\nEnter Final Grade:");
              final_grade= Integer.parseInt( finalgrade);
              while ( (final_grade<0) || (final_grade > 100) )
                        finalgrade= JOptionPane.showInputDialog ("Invalid Entry!\nA grade entered must be between (0-100).\nPleae Re-Enter the Final's Grade: ");
                        final_grade= Integer.parseInt( finalgrade);
              DecimalFormat twoDigits = new DecimalFormat( "0.00");
              //calculations for grades
                   //midterm is worth 40% of grade
              midterm_gradevalue = midterm_grade * .4;
                   //final is worth 60% of grade
              final_gradevalue = final_grade * .6;
                   //calculates the final grade for the student in class
              total_gradevalue = midterm_gradevalue + final_gradevalue;
              //if else statement for grade allotment
              if (total_gradevalue>=90)
                   lettergrade='A';
              else if (total_gradevalue>=80)
                   lettergrade='B';
              else if (total_gradevalue>=70)
                   lettergrade='C';     
              else if (total_gradevalue>=60)
                   lettergrade='D';     
              else if (total_gradevalue>=50)
                   lettergrade='F';          
              //Shows Output of Information Entered (5) of one student               
              JOptionPane.showMessageDialog
                   (null, "Student: " + secondname + " , " + firstname +
                        "\nMid-Term Points Earned: " + midterm_gradevalue +
                        "\nFinal Points Earned: " + final_gradevalue +
                        "\nTotal Points Earned: " + total_gradevalue +
                        "\nGrade Assigned: "+ lettergrade,
                        "\n STUDENT ID #: " + studentid,
                        JOptionPane.PLAIN_MESSAGE);
              /*Askes user whether or not to input an additional student*/
              option = JOptionPane.showInputDialog("Enter < 0 > to input a student. \nEnter < -1 > to quit. ");
              //converts string input into integer loop     
              loop = Integer.parseInt( option );
         listings +="Student ID #: " + studentid +
                   "\n [ " + secondname + ", " + firstname + " ] " +
                   "\n Midterm Points Earned: " + midterm_gradevalue +
                   "\n Final Points Earned: " + final_gradevalue +
                   "\n Total Points Earned: " + total_gradevalue +
                   "\n**********Grade Assigned: "+ lettergrade + "\n";
              } while ( loop !=-1);     
              JOptionPane.showMessageDialog(
                   null, listings,
                   "Class Results: ",
                   JOptionPane.PLAIN_MESSAGE);
              System.exit ( 0 );
         }//end of programming method
    }//end of class definition

    You didn't indent your code, so that makes it hard to read, and there's a lot of it that has nothing to do with what your question might be. But you want feedback? Well you are "validating" the student's first name in a strange way. A letter followed by any characters that aren't digits -- for example, "a++?" would pass. And that validation will fail if an empty string is provided, because "charAt(0)" assumes there is at least one character. I would just check it isn't blank. And I would provide a meaningful error message. "Invalid Entry" is unhelpful as it doesn't tell the user what is wrong with the input.

  • Replacing a char with string in a string buffer.

    Hi all,
    I have a huge xml file. Need to search for the following characters: ^ & | \ and replace each character with \T\ \F\ \B\ \C\ respectively.
    i.e. ^ must be replaced with \T\
    & must be replaced with \F\
    I see that it can be done in case of String using replaceAll() but have no clue about achieving using the stringbuffer??
    Any help is higly appeciated.
    Thanks in advance.

    Hi all,
    I have a huge xml file. Need to search for the
    following characters: ^ & | \ and replace each
    character with \T\ \F\ \B\ \C\ respectively.
    i.e. ^ must be replaced with \T\
    & must be replaced with \F\
    I see that it can be done in case of String using
    replaceAll() but have no clue about achieving using
    the stringbuffer??
    Any help is higly appeciated.
    Thanks in advance.here the solution for your problem:
    example code as follows,
         StringBuffer stringBuffer = new StringBuffer("your xml content");           
                String xmlString = stringBuffer.toString();
                char[]  xmlCharArray =  new char[];
                xmlString.getChars(0, xmlString.length()-1, xmlCharArray, 0);
               StringBuffer alteredXmlBuf = new StringBuffer();
                for(int i=0; i<xmlCharArray.length; i++){
                               if( xmlCharArray[i] == '^'){
                                      alteredXmlBuf.append(" \\T\\") ;
                               }else if(xmlCharArray[i] == '&'){
                                      alteredXmlBuf.append(" \\F\\") ;
                               }else if(xmlCharArray[i] == '|'){
                                      alteredXmlBuf.append(" \\B\\") ;
                               }else if(xmlCharArray[i] == '\'){
                                      alteredXmlBuf.append(" \\C\\") ;
                               }else {
                                       alteredXmlBuf.append(xmlCharArray);
    now alteredXmlBuf StringBuffer object contains your solution.

  • Extra char appears string to FML fails. - Urgent

    We are facing an issue we have not scene before.
    Its between OSB -> Tuxedo WTC integration.
    We being the team Supporting Tuxedo related Applications can see :
    Whenever we get a message with 00 at the end it gets successfully processed
    12:45:06.0747:17687: >>> [DUMP] Call the remote service (len=210) >>>
    12:45:06.0747:17687: 0000 30 30 30 30 30 30 30 30 30 30 30 31 2d 4a 55 4e 2d 32 000000000001-JUN-2
    12:45:06.0747:17687: 0012 30 31 32 31 32 3a 34 35 3a 30 35 20 20 20 20 20 20 50 01212:45:05 P
    12:45:06.0747:17687: 0024 49 4e 47 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ING
    12:45:06.0747:17687: 0036 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    12:45:06.0747:17687: 0048 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    12:45:06.0747:17687: 005a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    12:45:06.0747:17687: 006c 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    12:45:06.0747:17687: 007e 20 20 20 20 46 4d 54 2d 45 52 52 20 31 30 30 34 20 52 FMT-ERR 1004 R
    12:45:06.0747:17687: 0090 45 51 3a 4f 77 6e 65 72 20 66 69 65 6c 64 20 69 73 20 EQ:Owner field is
    12:45:06.0747:17687: 00a2 69 6e 76 61 6c 69 64 20 20 20 20 20 20 20 20 20 20 20 invalid
    12:45:06.0747:17687: 00b4 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    12:45:06.0747:17687: 00c6 20 20 20 20 20 20 20 20 20 20 20 20 *00* .
    but when we get a message with 01 at the end it fails :
    13:41:04.0489:24216: >>> [DUMP] Call the move data function (len=210) >>>
    13:41:04.0489:24216: 0000 30 30 30 30 30 30 30 30 30 30 32 31 2d 41 55 47 2d 32 000000000021-AUG-2
    13:41:04.0489:24216: 0012 30 31 32 31 35 3a 34 30 3a 35 38 20 20 20 20 20 20 50 01215:40:58 P
    13:41:04.0489:24216: 0024 49 4e 47 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ING
    13:41:04.0489:24216: 0036 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    13:41:04.0489:24216: 0048 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    13:41:04.0489:24216: 005a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    13:41:04.0489:24216: 006c 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    13:41:04.0489:24216: 007e 20 20 20 20 46 4d 54 2d 45 52 52 20 31 30 30 34 20 52 FMT-ERR 1004 R
    13:41:04.0489:24216: 0090 45 51 3a 4f 77 6e 65 72 20 66 69 65 6c 64 20 69 73 20 EQ:Owner field is
    13:41:04.0489:24216: 00a2 69 6e 76 61 6c 69 64 20 20 20 20 20 20 20 20 20 20 20 invalid
    13:41:04.0489:24216: 00b4 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    13:41:04.0489:24216: 00c6 20 20 20 20 20 20 20 20 20 20 20 20 *01*
    When we asked the OSB Application Supporting teams they told they are just sending the message like below without 00 or 01 at their end:
    13:41:04.0489:24216: 0000 30 30 30 30 30 30 30 30 30 30 32 31 2d 41 55 47 2d 32 000000000021-AUG-2
    13:41:04.0489:24216: 0012 30 31 32 31 35 3a 34 30 3a 35 38 20 20 20 20 20 20 50 01215:40:58 P
    13:41:04.0489:24216: 0024 49 4e 47 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ING
    13:41:04.0489:24216: 0036 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    13:41:04.0489:24216: 0048 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    13:41:04.0489:24216: 005a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    13:41:04.0489:24216: 006c 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    13:41:04.0489:24216: 007e 20 20 20 20 46 4d 54 2d 45 52 52 20 31 30 30 34 20 52 FMT-ERR 1004 R
    13:41:04.0489:24216: 0090 45 51 3a 4f 77 6e 65 72 20 66 69 65 6c 64 20 69 73 20 EQ:Owner field is
    13:41:04.0489:24216: 00a2 69 6e 76 61 6c 69 64 20 20 20 20 20 20 20 20 20 20 20 invalid
    13:41:04.0489:24216: 00b4 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    13:41:04.0489:24216: 00c6 20 20 20 20 20 20 20 20 20 20 20 20
    I am unable to understand is it Tuxedo which adds the character 00 or 01 and why?
    The message what reached our end is a fixed length String (210) which needs to get populated in an FML buffer and need to be send to an Unisys system via OSITP.
    Below is the headerfile generated compiling the view file :
    char ISPEC[5];
    char GLB_SOURCE;
    char TRANNO[6];
    char INPUT_DATE[7];
    char ACTMTH[4];
    char MXIMSG[10];
    char MSGDTE[11];
    char MSGTME[8];
    char OWNCDE[3];
    char LOCCDE[3];
    char REFNBR[12];
    char MFRDTE[11];
    char PT_NBR[25];
    char SHFDTE[11];
    char RCVNBR[10];
    char RCVDTE[11];
    char SERNBR[15];
    char REM401[40];
    char REM402[40];
    Please help.

    This is a sample error message :
    This is the XML send to WTC :
    01 Sep 2012 12:09:29,851 INFO ComponentReceiptErrorNotificationService_V1: [PipelinePairNode1, PipelinePairNode1_request, Error response received from EI, REQUEST] QISF.ComponentReceiptErrorNotificationService_V1: Component_receipt_response, error response received from EI<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <********************* xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <MessageIdentifier>13391</MessageIdentifier>
    <MessageDeliveryDate>01-SEP-2012</MessageDeliveryDate>
    <MessageDeliveryTime>12:09:25</MessageDeliveryTime>
    <Owner>SPL</Owner>
    <Location>SDC</Location>
    <PONumber>QS12236016</PONumber>
    <PartNumber>E21368000-1</PartNumber>
    <ManufacturedDate/>
    <ShelfLifeDate>07-JUN-2022</ShelfLifeDate>
    <ReceiptNumber>122450189</ReceiptNumber>
    <ReceiptedDate>01-SEP-2012</ReceiptedDate>
    <SerialNumber>0765E21368</SerialNumber>
    <Remarks>ERROR: Duplicate Serial Number</Remarks>
    </*********************>
    </soapenv:Body>
    01 Sep 2012 12:09:29,851 INFO ComponentReceiptErrorNotificationService_V1: [Route to Supply, null, null, REQUEST] QISF.ComponentReceiptErrorNotificationService_V1: Component_receipt error response routed to Supply<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <********************* xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <MessageIdentifier>13391</MessageIdentifier>
    <MessageDeliveryDate>01-SEP-2012</MessageDeliveryDate>
    <MessageDeliveryTime>12:09:25</MessageDeliveryTime>
    <Owner>SPL</Owner>
    <Location>SDC</Location>
    <PONumber>QS12236016</PONumber>
    <PartNumber>E21368000-1</PartNumber>
    <ManufacturedDate/>
    <ShelfLifeDate>07-JUN-2022</ShelfLifeDate>
    <ReceiptNumber>122450189</ReceiptNumber>
    <ReceiptedDate>01-SEP-2012</ReceiptedDate>
    <SerialNumber>0765E21368</SerialNumber>
    <Remarks>ERROR: Duplicate Serial Number</Remarks>
    </*********************>
    </soapenv:Body>
    The MFL transformation gives a dump like this :
    00000000:     30 30 30 30 30 31 33 33 37 33 30 33 2D 53 45 50     000001337303-SEP
    00000010:     2D 32 30 31 32 33 3A 34 33 3A 31 38 20 51 46 41     -20123:43:18 QFA
    00000020:     53 44 43 56 37 39 38 35 36 30 20 20 20 20 20 30     SDCV798560     0
    00000030:     31 33 32 41 42 55 20 20 20 20 20 20 20 20 20 20     132ABU          
    00000040:     20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                     
    00000050:     20 20 20 20 20 20 20 20 20 20 20 20 20 20 31 32                   12
    00000060:     56 37 39 38 35 36 20 20 30 33 2D 53 45 50 2D 32     V79856  03-SEP-2
    00000070:     30 31 32 53 45 52 49 41 4C 37 20 20 20 20 20 20     012SERIAL7      
    00000080:     20 20 45 52 52 4F 52 3A 20 49 6E 76 61 6C 69 64       ERROR: Invalid
    00000090:     20 50 61 72 74 20 43 6C 61 73 73 20 2D 20 42 41      Part Class - BA
    000000a0:     54 43 48 20 20 20 20 20 20 20 20 20 20 20 20 20     TCH             
    000000b0:     20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                     
    000000c0:     20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                     
    000000d0:     20 20 .. .. .. .. .. .. .. .. .. .. .. .. .. ..        ..............
    Hence we got this below in our tuxedo Application Log:
    12:09:29.0986:3421: >>> [DUMP] svc=MXRSUPP01, type=REQ (len=210) >>>
    12:09:29.0986:3421: 0000 30 30 30 30 30 31 33 33 39 31 30 31 2d 53 45 50 2d 32 000001339101-SEP-2
    12:09:29.0986:3421: 0012 30 31 32 31 32 3a 30 39 3a 32 35 53 50 4c 53 44 43 51 01212:09:25SPLSDCQ
    12:09:29.0986:3421: 0024 53 31 32 32 33 36 30 31 36 20 20 45 32 31 33 36 38 30 S12236016 E213680
    12:09:29.0986:3421: 0036 30 30 2d 31 20 20 20 20 20 20 20 20 20 20 20 20 20 20 00-1
    12:09:29.0986:3421: 0048 20 20 20 20 20 20 20 20 20 20 20 30 37 2d 4a 55 4e 2d 07-JUN-
    12:09:29.0986:3421: 005a 32 30 32 32 31 32 32 34 35 30 31 38 39 20 30 31 2d 53 2022122450189 01-S
    12:09:29.0986:3421: 006c 45 50 2d 32 30 31 32 30 37 36 35 45 32 31 33 36 38 20 EP-20120765E21368
    12:09:29.0986:3421: 007e 20 20 20 20 45 52 52 4f 52 3a 20 44 75 70 6c 69 63 61 ERROR: Duplica
    12:09:29.0986:3421: 0090 74 65 20 53 65 72 69 61 6c 20 4e 75 6d 62 65 72 20 20 te Serial Number
    12:09:29.0986:3421: 00a2 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    12:09:29.0986:3421: 00b4 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    12:09:29.0986:3421: 00c6 20 20 20 20 20 20 20 20 20 20 20 20 *01* .
    I am surprised where from this *01*/*00* appears at the end?
    Is this 01/00 added by Tuxedo or OSB Business service ?How can we change it to 00?
    Edited by: 835542 on Sep 3, 2012 11:30 AM
    Edited by: 835542 on Sep 3, 2012 11:38 AM

  • Commapi Returns 3 Char Hex String.

    Hi Every body,
    I'm using the COMMAPI to talk to a serial port, and I'm getting the reponse the form of a 3 char string, with each of the char being in the range 0-F (obviously a Hex Digit).
    So Far I'm converting the string into a char array and looping througth and manually converting the valueds (which will always be three chars), so i'm doing a:
    Convert to Array.
    For (i=0; i<array.lerngth;i++) {
    if (i=1) then { MulValue = 256 }
    if (i=2) then { MulValue = 16 }
    if (i=3) then { mulValue = 1}
    if (char(i) = F) DigitValue = 15
    if (char(i) = A) DigitValue = 10
    if (char(i) = 0) DigitValue = 0
    char_value = DigitValue * MulValue.
    intVal = intValue+charValue.
    return intVal,
    Can anybody think ok a more effiecnt way of doing this?, i've looked througth the API but there doesn't seem to be anything directly useful.

    How about this:
    char c = (char) Integer.parseInt(threeCharHexString, 16);

  • Replacing chars in strings

    Here is the situation:
    int x=4
    char letter1='Z'
    String word1="blah blah"
    /code]
    I was wonering if the was an easy way of replacing a character in a string with another at a ceratin point in the string. In this case, I want a string that would say "blahZblah". Thanks.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Sure
    int x=4
    char letter1='Z'
    String word1="blah blah"
    [String word2 = word1.substring(0,x) + letter1 + word.substring(x + 1)[/b]

  • Hex chars in strings

    Hi
    Is it possible to insert hex chars inside a string, like unicode chars \u, but for hex, like \0xFF....
    I have \x in my java book but that doesnt work.

    Hi,
    Just use it without '\'
            System.out.println("Character with value hex value 41: " + (char)0x41 + " Can you see it?");Prints:
    Character with value hex value 41: A Can you see it?
    /Kaj

Maybe you are looking for

  • How can i tell if my i mac is available

    my ipod touch 4th gen cant sync via wifi. it says that the sync will continue when my imac is available what can i do

  • ITunes has gone apesh*t! Please help! (can't locate files)

    Good day! I recently installed iTunes 7 (a few weeks ago, I guess.) For the most part, it has been working fine. But tonight, when I opened iTunes, it asked questions as if it had just been installed for the first time. Now, all my music is stored on

  • CQ5 image gallery component

    Hi, I'm a newbee in CQ5. I need to create an image gallery similar to http://goo.gl/RGBXs. How can I proceed towards that? I was thinking of taking a DAM folder path from the content author as an input and using that I would create the block by itera

  • Multiple ethernet addresses vs. IP addresses

    Hi, Using Workgroup Manager on SLS 10.6.4, I have successfully mapped hosts and their MAC addresses to fixed IP addresses within our LAN. All is well, until someone works on the back of one of the Mac Pros and ends up plugging the ethernet cable into

  • Saving IT0008

    I have an HR module requirement that when ever user create a IT0008 'Basic Pay' Infotype  and after that when he press the SAVE button the system after saving should take the user to the selection screen of 'PAY STATUS REPORT' as the name suggest its