import java.io.*; import java.util.*; class Delimit2 { public static void main(String[] args) throws IOException { Scanner filein = new Scanner(new File("file.txt")).useDelimiter(",[ \n\r\t]*"); while ( filein.hasNext() ) { System.out.printf("(%s)", filein.next() ); } } }