Got different types of information, which are evenly spaced apart.
LUONGO ROBERT M 1,69 64,9 2343
BUSH GEORGE M 1,47 52,2 1941
GOLDBERG JOHN M 1,89 72,3 2101
PAULSON MARTIN M 1,73 60,5 2232
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.
Got different types of information, which are evenly spaced apart.
LUONGO ROBERT M 1,69 64,9 2343
BUSH GEORGE M 1,47 52,2 1941
GOLDBERG JOHN M 1,89 72,3 2101
PAULSON MARTIN M 1,73 60,5 2232
Those lines that you have posted can be read into a String (for example with the Scanner class methods)
Then what do you want done with the data?
The String class's split method will separate a String at the spaces.
I'd like to use substring since I already wrote a method to read lines and convert them into strings. Do I need to write a method in my class file? I have no idea how to do this exactly.
The Scanner class would be easier to use to get the words out of the String.
To use the substring method, you would need to find the location of first byte and the location of last byte of each token and use their values in a substring method call. Finding the first non blank character after the end of a token will require a search loop to loop at each character in turn until you find a non blank. It can be tedious coding.