Lets say i have a file "userDistance.txt" with the contents:
Legend:
A B C D E
Distance:
{0}
{10 0}
{11 12 0}
{11 12 13 0}
{11 12 13 14 0}
Using Scanner and FileInputStream, how do i extract the data for legend and distance and store:
1. ABCDE in to String called legend
2. The distance matrix into a multidimensional array
I have tried things like
To detect the 1st line with the word Legend and extract all the characters after Legend, but it doesnt work.Code:if(inputStream.next()=="Legend:") or nextLine()
Please help, thx guys...