Hey can anyone help me - I am trying to implement
String Tokenizer into this program. So far the program reads a txt file and then stores every line into an array (and can print them). However, the txt files Ill be dealing with will be made up of just 2 columns of numbers, and Im trying to split each column up and then hold them in 2 new arrays. At the moment im struggling to get the first token into a new array (address). Any ideas?
public String[] getTextLines(File f)
{
final int MAX = 200;
int count = 0;
String[] getTextLines = new String [MAX];
String[] address = new String [MAX];
BufferedReader inFile;
try
{
FileReader fr = new FileReader (f);
inFile = new BufferedReader(fr);
try
{
String line = inFile.readLine();
while (line != null)
{
getTextLines[count++] = line;
line = inFile.readLine();
//tokenizer = new StringTokenizer(line);
//address[count] = tokenizer.nextToken();
}
}
catch (IOException exception)
{
}
}
catch(FileNotFoundException exception)
{
}
return getTextLines;
}