3 Replies Latest reply: Jan 5, 2009 2:11 PM by 843785 RSS

    Help needed on string tokenizer

    843785
      Hi, I need help on string tokenizer.

      Currently, I have some .dat files that contain data of stock prices and a ";" is used to separate each field.

      Can somebody show me how to:
      1. read the .dat files,
      2. use string tokenizer to separate the ";" and insert into MySQL database?

      Thanks a lot!

      Edited by: burian on Jan 4, 2009 9:30 PM
        • 1. Re: Help needed on string tokenizer
          843785
          We don't really write code for other people on this forum. We just help if there's a specific problem. Your problem seems to be that you don't know how to program, so I'll help you by suggesting that you start from some Java tutorial.

          If this is just a poorly phrased question, here's some tips:


          1. Read the .dat files in the standard way (I'm assuming they're text files)
          2. Tokenize in the standard way (or use .split())
          3. Insert into MySQL in the standard way (make sure they're all in the same transaction)
          • 2. Re: Help needed on string tokenizer
            843785
            Part 1. Search for the topic "File Input Output with java". There are many very efficient ways to do this.
            Part 2. Search for the topic "Tokenising and Regular Expressions with java"
            Part 3. Search for the topic "JDBC Connectivity"

            There are thousands of examples and tutorials available on the net. Try it out and if you still have problems post them here.
            • 3. Re: Help needed on string tokenizer
              843785
              Here let me help you out. Read this tutorial/example it contains reading/writing from text files and using the tokenizer:

              [Reading Writing text files.|http://www.javapractices.com/topic/TopicAction.do?Id=42]