import java.io.*;
import java.util.*;

/**
 * An example that illustrates how to read the
 * contents of a 2-D array
 *
 * @author  Prof. David Bernstein, James Madison University
 * @version 1.0
 */
 public class TableReader
 {
    /**
     * The entry point of the application
     *
     * @param args   The command-line arguments
     */
    public static void main(String[] args) throws IOException
    {
		BufferedReader       myBufferedReader;
		FileReader           myFileReader;
		InputStreamReader    myInputStreamReader;
		int                  column, prof;
		String               line, token;
		String[][]           table;
		StringTokenizer      tokenizer;


			// Setup the reader and writer
		myFileReader 		= new FileReader("cs.txt");
		myBufferedReader 	= new BufferedReader(myFileReader);

			// Construct the table
		table = new String[10][3];

			// Read, tokenize and store
		for (prof=0; prof < table.length; prof++)
		{
	 	   line = myBufferedReader.readLine();
	  	   tokenizer = new StringTokenizer(line,"\t");

	    	for (column=0; column < table[prof].length; column++)
	    	{
					// What happens if a field is empty?
				token = tokenizer.nextToken();
				table[prof][column] = token;
	    	}
		}


			// Print the table
		for (prof=0; prof < table.length; prof++)
		{
	 	   for (column=0; column < table[prof].length; column++)
	  	   {
				System.out.print(table[prof][column]+",  ");
	   	}
	      System.out.print("\n");
		}

   }

}
