I have a file looks like:
a 1,2,3,5
b 4,5,6,7
c 5,6,7,8
...
That the separator between 1st and 2nd is \'\\t\', other separators are comma.
Scanner scan = new Scanner(file);
while (scan.hasNextLine()) {
String[] a = scan.nextLine().replace("\\t", ",").split(",");
//do something with the array
}
scan.close();
This did: