Reputation: 305
This is an example of the text that I need to manipulate:
YEAR (space) MONTH (space) NAME (space)
YEAR (space) MONTH (space) NAME (space)
YEAR (sapce) MONTH (space) NAME (space)
YEAR (sapce) MONTH (space) NAME (space) ...
How would one go about creating an array using only the values in one column? e.g the second column (months) or the last column (names)
Upvotes: 2
Views: 1716
Reputation: 8227
Read this answer. See also the split method of String Class in Java Api.
Upvotes: 0
Reputation: 61526
Take a look at the java.util.Scanner class, specifically the hasNext and next methods.
Upvotes: 3
Reputation: 695
read each line and split on space, and reformat the array..
read each line and use a substring to add to the array..
read each line and use regular expression..
Upvotes: 4