Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: BufferedReading

  1. #1
    Member
    Join Date
    Dec 2011
    Posts
    34
    My Mood
    Cheerful
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default BufferedReading

    For my server to work (to be able to execute certain processes), I need to be able to read this certain file. This file contains 5 different variables separated by tabs. How would I go about grabbing each of those variables? I know how to grab the whole line using a Scanner, but it won't print out the variables separately.

    Here's an example:

    NPC = 5\t6t7\t8

    I want to be able to grab 5, 6, 7, and 8 and print it out separately.

  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,896
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: BufferedReading

    Have you read the Scanner API? It has methods for extracting the next integer or next word from a string.