Can i link a StreamTokenizer with a String Tokenizer?

As recently informed, I now know that I can treat delimiters as tokens using StringTokenizer. My next question, is how do I use a StringTokenizer with a StreamTokenizer to let me read a word (eg cat) as a token and also a "," as a token? The reason being that I would like to be able to use the 'end of file' and 'end of line' flags in the StreamTokenizer but also would like to treat certain delimiters as tokens using the StringTokenizer!
If this is not possible, would I need to use the StringTokenizer and treat a space(" ") as a token (or delimiter)?
If I read a token with the StringTokenizer can I expect the StreamTokenizer to read the next token after that, or is that wishfull thinking?
The following code was used just to read words as tokens. I would like to incorporate the StringTokenizer to set delimiters as tokens to be read. How??????
try
    File file = new File("test.txt");
    FileInputStream stream = new FileInputStream (file);
    InputStreamReader reader = new InputStreamReader (stream);
    BufferedReader buffer = new BufferedReader (reader);
    StreamTokenizer tokenize = new StreamTokenizer (buffer);
    tokenize.nextToken();
    while (tokenize.ttype != StreamTokenizer.TT_EOF)
        data = tokenize.sval;
        tokenize.nextToken();
catch(IOException e)
    System.out.println("Error in file input:" + e.toString());
    }

I don't think you should do it that way, it can get a little nasty. Just use a BufferedReader to read one line in at a time, then use a StringTokenizer to break it up. When a reader has reached the eof, the readLine returns a null.

Similar Messages

  • How can I link table KONV with table VBRP and VBRK using KSCHL field?

    Hi experts,
    How can I link table KONV with table VBRP/VBRK using KSCHL field so that items are fully filtered?
    Thanks,

    Hi,
    If you do not want to specify it as hard code, then define a variable for it if you want to pass the value for it from the selection screen so that it will be dynamic. Code will be as follows.
    select-options: x_KSCHL for T685l-KSCHL.
    select kwert
               kbetr
               knumv
               kposn
               kschl
          from konv
          into CORRESPONDING FIELDS OF TABLE it_konv
          FOR ALL ENTRIES IN it_all
          where knumv = it_all-knumv
          and   kposn = it_all-b_posnr
          and   kschl in x_KSCHL. "Dynamic Selection as per the selection screen input
      endif.
    Hope this helps.
    Regards,
    Chandravadan

  • How can I link my database with flash?

    Hi…
    How can I link my database with flash to display image (to
    display it in master details page)
    Please your help ASAP.
    Regards,

    You could use some server-side scripting like PHP or ASP.
    http://www.kirupa.com/web/index.htm

  • How can I link my iPhone with my iPad?

    How can I link my iPhone with my iPad?

    If you mean link using iCloud, go to Settings>iCloud and sign in with the same ID on both of them, then turn on the data you want to sync.

  • I can't link menu items with the areas in the page:

    I download a theme over imternet and menu and the page areas not linked how can i do that ?
    When i press the communication button i stays constant
    but there is communication section and i can't linked them.

    You cannot link default menu items , default menu includes the link to pages ( site structure).
    You would need to create a manual menu if you want to link new pages to menu items. Please let me know if you are not looking for this answer.
    Thanks,
    Sanjit

  • Oracle Purchasing - How can I link a requisition with a purchase order?

    Hi All,
    I have a problem. I don´t know how to lonk a requisition with a purchase order.
    I use the following tables:
    PO_REQUISITION_HEADERS_ALL
    PO_REQUISITION_LINES_ALL
    PO_LINES_ALL
    PO_HEADERS_ALL
    PO_DISTRIBUTIONS_ALL
    Those are the mains tables, but I can´t obtain a purchase order information based on a created requisition.
    Someone could help me?
    Thanks,
    Facundo.

    Absolutely, Emile.
    Use the Tooltip Widget. Inside the Tool Tip you can put what ever content you wish. Let me know if that works for you.
    If not can you supply a link?

  • Can I link a query with an Excel file without using universe designer?

    Post Author: nicmac3030
    CA Forum: WebIntelligence Reporting
    I have an Excel file that contains a list of 200 seller codes.  The list is updated on a weekly basis.
    I need to create a query in Webi that shows ONLY those records in our main table that match one of the seller codes on the Excel list.
    Is there an easy way of doing this?  I don't really want to hassle our universe designer guy with a new file to import every week.  But if that's the only way to do it, we will have to.
    Back in BO v5 we used an Excel macro to add all the codes into a long text string with commas & pasted that into the query designer.  Unfortunately there are many queries that need to be updated, so hopefully there's a way to automate this.
    Thanks for your help.  Cheers, Nick

    Post Author: jsanzone
    CA Forum: WebIntelligence Reporting
    Nick,
    You don't mention what version of BusinessObjects that you are using.  If you are going to adopt XI 3.0 sometime soon, then you will have a definite capability of doing what you want with a new product included in 3.0 called "Rich Client".  At this moment I can't think of any other way to achieve what you want other than RC.  You can read more about RC at the Business Objects docs web site, here: http://support.businessobjects.com/documentation/product_guides/boexir3/en/xi3_web_intelligence_rich_client_en.pdf

  • Can I link my iphone with an ipad?

    I was looking at getting an iPad, but wasn't sure whether I'd be able to link my iPhone 4 with it. I wanted to ideally get a laptop so that I could update my iPhone etc. Could someone let me know whether I'd be able to update my iPhone on an iPad or will it just be a pc?
    Thank you

    only on a pc an ipad operate the same way as your iphone in that respect
    you can only sycn, backup and upgrate os on a pc with both of them

  • How can i link REGUP table with RBKP table..

    Hi..
    I wanted to get a unique record from RBKP for each of the record found in the REGUP..
    Can you please let me know if that is possible and if so what are the fields that you should be using to link both the tables...
    Apprecitate your help...
    Thanks,
    Kanthi..

    Hi
    I don't if there's a direct link between RBKP and REGUP, but there is the link between BKPF and RGUP.
    So you can use BKPF table to create a link between RBKP and REGUP.
    CONCATENATE RBKP-BELNR RBKP-GJAHR INTO AWKEY.
    SELECT * FROM BKPF WHERE AWTYP = 'RMRP'
                         AND AWKEY = AWKEY.
    ENDSELECT.
    and so:
    SELECT * FROM REGUP WHERE BUKRS = BKPF-BUKRS
                              BELNR = BKPF-BELNR
                              GJAHR = BKPF-GJAHR
    Max

  • Can I link this site with my Gmail account?

    <i>(Personal information removed by Moderator. Please read the [[Forum rules and guidelines]] -m)</i>
    Read above.

    Kellyluvsmaria,
    You can, however you will need to sign up with the gmail account. I do not think you can add an email to your account in the forums at the moment.

  • How can I link my iPhone with a new MacBook if I have apps on the iPhone from 3 different Apple ID accounts?

    Since I live in three diffirent countries and I have 3 Apple ID accounts on my iPhone 4S. Recently I bought a MacBook Pro with Mountain Lion installed.
    I am not sure that when I connect my iPhone with a new MacBook all my data (apps, music, podcasts, etc.) will be transferred from the iPhone to MacBook iTunes.
    So what should I do to transfer all my data to the new MacBook and to sync the data with iPhone as usual?

    Follow the steps here, but when you come to the part about "authorizing" this computer, you will have to do so for each account/Apple Id:
    https://discussions.apple.com/docs/DOC-3141

  • Can you link a layer with a path?

    So that when you resize your object in the layer the path resizes with the object in the layer automatically.

    Layer > Vector Mask > Current Path

  • File uri with query string can't be propagated by desktop.browse()

    I have been trying to show some help pages using the following command:
    java.awt.Desktop.getDesktop().browse( helpURI);
    while the helpURI.toString() prints out the following:
    file:///C:/Share/Code/phoenix/Install/REDIST/Help_Files/en/wwhelp/wwhimpl/js/html/wwhelp.htm?context=BD&href=Chapter%202%20-%20Configuration.1.14.html
    But when the getDesktop().browse() API is executed it will only propagate the uri-path and not the query string.
    So the browser shows the following url as a result of the browse() call:
    C:\Share\Code\phoenix\Install\REDIST\Help_Files\en\wwhelp\wwhimpl\js\html\wwhelp.htm
    But if I manually copy the string "file:///C:/Share/Code/phoenix/Install/REDIST/Help_Files/en/wwhelp/wwhimpl/js/html/wwhelp.htm?context=BD&href=Chapter%202%20-%20Configuration.1.14.html" to the internet explorer it works fine.
    So can somebody give me any guidance on how I can propagate the file uri with query string through the browse() API or is there a better API for that?
    Sibon.

    The "cmd /S /C" suggestion didn't seem to work. I don't think the problem is in java but how the command line parameter needs to be added from msdos shell to "iexplore.exe"
    When from the command line I enter the following command:
    iexplore.exe file:///C:/Share/Code/phoenix/Install/REDIST/Help_Files/en/wwhelp/wwhimpl/js/html/wwhelp.htm?context=BD&href=Chapter%202%20-%20Configuration.1.14.html
    I get the same result as invoking from java Desktop API --- it truncates everything from question mark. I tried palying around with double quotes, single quotes, escaping and nothing seem to work.
    Any ideas?

  • Odbc connection test success but can't link the database to oracle with 1013 call failed error.

    i am using my MS Access 2013 to connect with my oracle database. I created the odbc link and successfully have connection test pass. However i can;t link the database with my MS access. When i am using different software (mapinfo), i am able to connect to oracle database. The error is"1013: user requested cancel of current operation"

    In MS access, i open the external data and select odbc. Select my odbc link created previously, enter the password and after a while the error message pop up.
    But if i am using another tools, such as SQL Developer or Mapinfo, i will able to connect to oracle database using the same odbc link.

  • Can we create a structure with string type not char??

    Hi All
    Can we create a structure with type STRING not as a CHAR type??
    Please its urgent.
    Regards
    Deepanker

    HI,
    Yes, you can string instead of CHAR.
    Please follow the steps below :
    SE11 --> Table name --> Create Button --> And input the short description and necessary Delivery and Maintenance fields --> Select Fields tab --> Input some name on field --> And Click on Predefined button --> Press F4 on Data type column --> a Pop window will be displayed --> Select String from that.
    Thanks,
    Sriram Ponna.

Maybe you are looking for

  • How to get a host-name representing a WebLogic cluster

    Hi guys, We are using weblogic to deploy a service. Service uses the below property to connect on managed port and get datasource informations PROVIDER_URL=t3://abc.com:20005 Now this is fine but in PRODUCTION we have cluster who have 2 machines-mang

  • How to create a calendar that is *not* in iCloud?

    Hi, In the Calendar application, it seems I can only create iCloud calendars. Is there a way to create a calendar that does not get copied to the internet? Rob

  • Offline backup delayed

    Hi, Our SAP PRD offline Brbackup backup is getting delayed by 30 mins plus every monday morning. My system is: sap 46c, oracle 9.2, sun solaris 5.9 Brbackup version is 6.40 Total backup space is: 937474.158 MB(322 files) <b>Earlier backup used to fin

  • Full Screen protector For iPhone 6

    I've noticed a lot of screen protectors only sit on the front and don't cover the whole front face (I'm thinking because of the curve). Anyone know of a protector that covers the full face?

  • 1000 Claues in IN Clause

    I found that one can not choose more than 100 values in a IN Clause SELECT col1, col2 from MY_TABLE where col3 IN (1,2,3,4,5,..............10000, 10001...) I have to pull up a report of about 25K users and currently what I am doing is runing it for 1