Java useDelimiter problem

Category: Java EE
 
wanghao0211
2011-08-09 07:25:14

Sponsored Links
File file = new File ("db / test.txt");
try {
Scanner input = new Scanner (file);
input.useDelimiter ("\ \ | | \ \ | ="); This line inside the rules how to modify?
while (input.hasNext ()) {
String Names = (input.next ());
String age = input.next () ;
String Score = input.next ();
System.out.println (Names + Time + Score);
}
} catch (FileNotFoundException e) {
/ / TODO Auto-generated catch block
e.printStackTrace ();
}

test.txt content is:
Tom | math | = 90
Terry | English | = 80

would like Tom, math, 90, Terry, english, 80 extracted.
Note "90", "80" after both newline;

Sponsored Links

Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.