Public feed #894221

Stuff

public text v1 · immutable
Raw Edit
·published 2008-02-06 19:58 UTC
rendered paste body
import java.io.*;
import java.util.ArrayList;
class Testing
{
  public Testing()
  {
    try
    {
      String[][] matrix;
      ArrayList list = new ArrayList();
      BufferedReader fr = new BufferedReader(new FileReader("data.txt"));
      String line = "";
      while((line = fr.readLine()) != null) list.add(line.replaceAll(" ",""));
      matrix = new String[list.size()][];
      for(int x = 0; x < matrix.length; x++) matrix[x] = ((String)list.get(x)).split(",");
      System.out.println(matrix[1][1]);
    }
    catch(Exception e){System.out.println("error - exiting");}
  }
  public static void main(String[] args){new Testing();}
}