Parsing single chars to a vector.

I'm reading from a file, using BufferedReader. Readig a line at a time. Currently i have a StringTokenizer which breaks up the line using whitespace. How can I break up the "input" line by single chars, and how do I get the delim to work using the StringTokenizer, so that I can use other char instdead of using whitespace- or set up mutliple delims.
Is there a way I could add the single chars to a vector as an indvidual element to the vector so that I can bump off the elements that I do not have a use for?

In order to use the " character, you need to use the escape character \" So, your statement would look like
st = new StringTokenizer(yourString,"\"<");The second char in that is a <, but the parser on the site sometimes converts it to the html code as & lt; Just use whatever chars you need in the second parameter
HTH

Similar Messages

  • How to use multiple hierarchies for a single char in single query

    Hi,
    Is there any way that we can use multiple hierarchies for a single char in single query. I tried and it just allows me to select one hierarchy even if I use hierarchy variable.
    I have a requirement where user wants to see information related to a cost center with different cost center groups in different hierarchies (every year has different cost center group hierarchies).
    Suppose I want to see information related to a cost center from year 2001-2004.in these four year cost center may have been associated to different groups depending upon that year hierarchy. How can I do that?
    Thanks
    Jona

    Nope. Now way to do this.
    There is always just one hierarchy assigned to a characteristic. And even if the hierarchy was time dependent, it only reads it for one key date and not according to transaction data.
    Regards,
    Beat

  • How to get the bounds of single char?

    How to get the bounds of single char in text frame?
    Thanks

    I also think there is not an exiting function which can get it, but we can work around. Can you give some ideas to work around it?

  • Single CHAR column

    Should I use CHAR(1) or VARCHAR(1) for a single char column?
    Thanks
    Venkat

    I think it doesnt matter CHAR or VARCHAR2
    I always go for CHAR(1) for mandatory single char column

  • Why Java cannot read a single char ?

    Hi all,
    Have you ever tried to read a single char in java
    and output to the screen? I have tried nearly all
    IO streams but it seems that System.in doesn't
    returns until a CR/LF is issued. Why is it implemented this way?
    Are there any alternatives (JNI ?) ?
    Thanks a lot
    Francesco

    Did you already try the next issue?
    public class test{
         public static void main(String[] args)
         throws Exception{
              System.out.print("Enter a character: ");
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    char ch = (char)br.read();
    System.out.println("You've entered: " + ch);
    Hope this help!

  • Keyboard input - single char

    All I want is a single character of keyboard input. Is there a better (simpler) way to do this?
    byte[]     bInput;
    String     cResult;
    bInput = new byte[1];
    bInput[0] = 0;
    System.out.print("\nStart FirewallChat in [C]lient or [S]erver mode? ");
    try
    {     System.in.read(bInput);
    } catch (IOException e)
    {     System.out.println("System.in.read(byte[] b) threw IOException. An I/O error occurred - maybe the input stream has been closed? Exception follows : " + e);
    System.out.println(Character.toLowerCase((char)new Byte(bInput[0]).intValue()));

    char c = (char)System.in.read();

  • Can a single char be used both in rows, filters and free chars

    Hi.,
      Can 0customer can be used in rows, filters and free chars at a time ?
    Or the chars which are used in either one of themrows or filters or free chars) cant beused in the other(rows or filters or free chars)?

    NOpe, it can only be used in one place.
    May be what you have seen is it could be a nav. attribute of master data and transactional data with the same name. Or the same object name could have been in two different underlying model of infoset and it would be dragged and dropped with the same name.
    thanks.
    Wond

  • Conditions in report (radiobutton : single char or combination of char)

    Hi friends,
    I have a got a doubt while writing conditions , could you please help me?
    Question : What is the use of "radiobutton: <u>single charateristics or combination of charateristics</u>" under  "Evaluate the conditions below" block.
    Points will be rewarded

    Hi
    You can find more information under Ranked List Condition: Top 5 Products and Ranked List Condition for All Characteristics in Drilldown Independent: Top 3 Products and Top 3 Sales Channels.
    ¡        If you want to evaluate the condition for certain drilldowns of defined characteristics or characteristic combinations, in the field Evaluate the Conditions Below for Single characteristics or Combinations of Characteristics. You can then make entries in the list of characteristics used in the queries in rows, columns, or free characteristics.
                                                      i.       If you only want to evaluate the condition when a certain characteristic is present in the drilldown, select this characteristic.
                                                    ii.       If you want to evaluate the condition for characteristic combinations, select multiple characteristics.  You can find more information under Ranked List Condition for Characteristic Combination: Top 3 Combinations of Product and Sales Channel.
    ¡        In the field Display all values for which at least one of the following conditions applies, enter one or more condition rows into the list. See Conditions/Exceptions: Add, Change, Delete Rows
    A condition row is always derived from the determination of an element for every structure used in the query (usually one or two structures), an operator, and a value that matches the operator.
    You can choose from the following operators for threshold conditions:

  • SAP single-char LANG key values

    I'm not sure where to ask this question. I'm trying to find out the legal values for a SAP LANG data type. This is a single-character key for a language (e.g. 'E' for English). Specifically, I'd like to know the keys for German, French, and Japanese. My guess would be 'D', 'F', and 'J', but I'd like another opinion. The SAP data element I was looking at is RSPOPALANG, but when I dig down into it in the dictionary I don't find an enumerated value range.

    Hi,
    If you check the Data element RSPOPALANG has the domain SPRAS under it and it has a conversion routine "ISOLA" attached to it.
    If you check the conversion routine, you can see that the values are coming from table T002.
    To answer your question:-
    English : E
    German : D
    French : F
    Japanese : J
    You were right about your guesses.
    Thanks & Regards,
    Renjith

  • How to Sort one key figure values in two column based on single char

    hi gurus,
    I would really appreciate if some one can help me out with my question.
    I have to design a query based on a Multiprovider built on three ODS, Purchasing, Confirmations & Invoic ODS
    Purchase order Value and Number data in PO ODS, and confirmations is in CONFODS, Invoice Values in INV ODS,
    The design of the requirement is
    Vendor --> PO --> Material PO Value --> Text PO Value  --> Confirmation value --> Invoice value
    There are Two POS 1. Material PO & 2. Text PO
    I need to display all the Purchase orders for a vendor and in different columns i need to display the value of the Material PO and Text PO and their Confirmation Value and how much is the invoiced value for every PO.
    Can anybody tell me what should i do in the Query Designer to display the necessary values.
    Thank you

    Hi william,
    When i put in the PO KF in the column and also the Confirmation KF in other Column it either shows me # for both the entries or it shows me values in only one of the column
    if PO is displayed the Confirmation is not displayed and if Confirmation is displayed PO values are shown as # i dont know what wrong i am doing.
    if you have idea can you tell me what i should do when i want two different values from two ODS if there are no characteristics that are matching in either of the ODS should i go for Multi Provider and if so how should be my designing. i would really appreciate if you can tell me taking a scenerio.
    Thanks

  • Parsing char[] to String

    I am trying to parse a char[]. Everytime I find a '\n' character I want to take the offset to that position and create a String from it. It doesn't seem to work like expected.. The strings contain parts of the array that shouldn't be there. here is some sample code that I am using. Let me know if anyone has any suggestions..
    Thanks
    public void parseArray( char[] buf ){
    int offset = 0;
    Vector v = new Vector();
    for( int i=0; i < buf.length; i++ ){
    if ( buf[ i ] == '\n' ){
    v.add( new String( buf, offset, i ) );
    offset = (i +1);
    }

    Try:
         public Vector parseArray(char buf[]) {
              Vector v = new Vector();
              String s = new String(buf);
              int offset =0, pos;
              do {
                   pos = s.indexOf('\n',offset);
                   if (pos != -1) {
                        String sub = s.substring(offset, pos);
                        v.add(sub);
                        offset = pos+1;
              } while (pos != -1 && offset < buf.length);
              if (offset < buf.length)
                   v.add(s.substring(offset));
              return v;
         }

  • SAXParser parse method

    Hello,
    I'm trying to parse with SAX a XML file coming from remote device, but i Tomcat shows me error message as:
    Apache Tomcat/4.0.4 - HTTP Status 404 -
    http:\localhost:8080\fieldgate\output1.xml (Syntax file name or directory or volume is wrong)
    code is:
    <jsp:useBean id="parser" scope="page" class="beans.xml.sax.SAXParserBean" />
    <%  Collection elements = parser.parse("http://localhost:8080/fieldgate/output1.xml");
        Iterator it = elements.iterator();
    %>
    .........Someone can help me please?
    Thx
    Riccardo

    Ok this code is not mine but is taken from a manual:
    package beans.xml.sax;
    import java.io.FileReader;
    import org.xml.sax.Attributes;
    import java.io.IOException;
    import java.util.Vector;
    import org.xml.sax.Attributes;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import org.xml.sax.XMLReader;
    import org.xml.sax.helpers.DefaultHandler;
    import org.apache.xerces.parsers.SAXParser;
    public class SAXParserBean extends DefaultHandler {
       private Vector vector = new Vector();
       private SAXElement currentElement = null;
       private String elementText;
       public Vector parse(String filename) throws SAXException,
                                                   IOException {
          XMLReader xmlReader = new SAXParser();
          FileReader fileReader = new FileReader(filename);
          xmlReader.setContentHandler(this);
          xmlReader.parse(new InputSource(fileReader));
          return vector;
       public void startElement(String uri, String localName,
                                String qName, Attributes attrs) {
          currentElement = new SAXElement(uri,localName,qName,attrs);
          vector.addElement(currentElement);
          elementText = new String();
       public void characters(char[] chars, int start, int length) {
          if(currentElement != null && elementText != null) {
             String value = new String(chars, start, length);
             elementText += value;
       public void endElement(String uri, String localName,
                              String qName) {
          if(currentElement != null && elementText != null)
             currentElement.setValue(elementText.trim());
          currentElement = null;
    }

  • Bug in XML Java parser v2.0.2.8

    Hi, XML Team:
    When i try to transform some documents ( about 39Kb ) they not gets correctly parsed.
    At some point in the document a numeric entity reference get uncorrectly parsed.
    It parses a word like "relaci&#243;n" to "relacion&38;#243" and from that point part of the document is badly parsed, to some point in that the parses get resynchronized newly, and from this point to the end, the rest of the document get correctly parsed.
    When i say badly parsed i want to say that the "<" & ">" get parsed as entity references and not as part of an element,it seems to parse all that follows the badly parsed word as text() and not as elements.
    In the other hand, i discovered a very simple workaround: delete a single char from a point in the part of the file preceding the dangerous word, with this measure everything goes well, but it's not very good because my files are static ( not sql generated ) and i can do that, when i use the parser trought XSQL how can i prevent some query to have the dangerous lenth?.
    It seems that this bug is related to boundaries detection inside the code that reads from file, when the "&" character is read in the last byte of the buffer, it's not detected as part of entity reference and the entity reference is not readed as a whole but as a 2 things a "&" and after a "#243" that follows...
    I can send you a test bed that reproduces the bug, cleanly and consistetly.
    Saludos, Ignacio J. Ortega
    null

    Please email me test cases of both problems
    and we'll look into it ASAP. Thanks.
    The Jit one looks especially interesting.
    null

  • Text file: reading char one at a time line by line

    I need to read an external .txt file, one character at a time, line by line, and compare each character in order to do various things. The problem is that when I use the Buffered Reader I have only readLine() method and others to work with, but none that actually read a character at a time, and line by line. The program has to read a character, then move to the next one and read it, and so on. Then move to the next line, and read the first character, and so on. I am working with chars not Strings. Could you please help me with this problem?

    InputStreamReader can read a single char.
    InputStreamReader isr = new InputStreamReader(InputStream in);
    isr.read(); will return 1 character from "in".

  • Problem with special chars in BLOB datatype using contains keyword

    Facing problem, when part searching with special chars in BLOB datatype. It is considering the non alpha-numeric chars as a separtor in a provided string
    EX:
    SELECT *
    FROM RESUME_TEST P,grst_candidate d
    WHERE d.candidate_id = p.candidate_id
    AND CONTAINS(P.CAND_RESUME,'%VB.NET%',1) > 0
    Strings: , VB.NET , PL/SQL AS/400 , C etc..
    Followed the below approaches
    1) created a table:
    Syntax: create table resume_Test(cand_id number(10),cand_resume blob);
    2) inserted the values into this table upto 60,000
    3) created a context index
    3.1 created preferences
    Syntax:
    BEGIN
    ctx_ddl.create_preference('try_lexer3','BASIC_LEXER');
    ctx_ddl.set_attribute('try_lexer3','printjoins','-_~!@#$%^&*(){}[],=?\;|><.+');
    END;
    3.2 created context index
    Syntax:
    CREATE INDEX CANDRESUME_CTX_IDX ON resume_test (cand_resume)
    INDEXTYPE IS CTXSYS.CONTEXT
    PARAMETERS ('LEXER try_lexer3 memory 500M');
    4) while executing this index, it is taking much time approx 6 hrs(plz explain why it is taking time)
    5) Problems:
    5.1 when searching with string(VB.NET , PL/SQL AS/400 , C etc..) it is considering the special char as a separator
    5.2 used escape char (\) also, but no effect
    5.3 when searching with single char, it is giving error (ORA-29902,ORA-20000,DRG-51030)
    5.4 getting the above error with wild card chars (& ,_, (),{},[])
    So, please explain the clear scenarios, why am getting this error , and how to get the proper results.

    Have you tried adding the / char to the printjoin characters?
    Indexing can take a lot of time, depending on the amount of data and your machine's power. You could try to parallelize the index creation and / or assign more memory
    CREATE INDEX CANDRESUME_CTX_IDX ON resume_test (cand_resume)
    INDEXTYPE IS CTXSYS.CONTEXT
    PARAMETERS ('LEXER try_lexer3 memory 2000M') PARALLEL 8;

Maybe you are looking for

  • Problem with Resuming and Installing Apps Purchased using Mac App Store

    Recently I have been trying to download and install AeroFly FS which I purchased from Mac App Store (17GB) and with my internet connection it take some 4-5 days to download that. I have 2 problems. 1) Resume download don't work if I happen to reboot

  • Running SSRS report locally in separate thread

    We're using ASP.net with .Net 4, developing with Visual Studio 2012.  We use SSRS 2012sp1 with local reports, so exporting the report ourselves instead of using a reportviewer control (and not using the SQL Reporting service).  The reports are execut

  • Sender JDBC

    We have a scenario for sender JDBC adapter returning close to 2000 rows in a single snapshot. But I would like to split these at these into 2000 messages instead of 1 single message without using BPM. Any suggestions. Juan

  • Batch Emailing Photos in iPhoto '08

    Hello Emailing a photo or two is cake, as long as having the photo inline in the email is ok. If I wanted to send a batch of photos, say 30 and wanted them 'packaged' in a folder instead of inline in the message, what would be the simplest way of doi

  • Exporting to pure Black and White PDF

    Hi,      I've created the  document in mono/black and white, but have been asked by the printers to export the PDF as a pure black and white. I cannot seem to see these settings when exporting. Am I just missing something or is this not possible? Tha