Niall
Posts: 10
Nickname: niall
Registered: Feb, 2004
|
|
Re: Reading file input
|
Posted: Feb 7, 2004 10:31 AM
|
|
This is my code so far:
String vText; String lineRead=""; BufferedReader br = new BufferedReader(new FileReader(infile)); while ((lineRead = br.readLine()) != null) { vText = lineRead; StringTokenizer tokenizer = new StringTokenizer(vText); while (tokenizer.hasMoreTokens()) { String token = tokenizer.nextToken(); V1.addElement(token); } } [pre] This adds all elements in the input file described above to the vector V1. However I want to just add the elements up to the ; to V1, then the rest into a different vector V2
|
|