All pastes #797583 Raw Edit

Mine

public java v1 · immutable
#797583 ·published 2007-11-26 03:18 UTC
rendered paste body
import java.io.BufferedReader;import java.io.FileReader;import java.io.IOException;import java.util.ArrayList;public class readFile {	private static String arquivo = "testfile.txt";	private static String[] cabecalho;	private static String[][] persons;	public static void main(String[] args) {		try {			BufferedReader in = new BufferedReader(new FileReader(arquivo));			String str;			// Read and parse the file			int lines = 0;			while ((str = in.readLine()) != null) {				lines++;			}			cabecalho = str.split(",");						persons = new String[lines][cabecalho.length];						int line = 0;			while ((str = in.readLine()) != null) {				cabecalho = str.split(",");								for (int i=0; i<cabecalho.length; i++) {					persons[lines][i] = cabecalho[i];				}				line++;			}						in.close();		} catch (IOException e) {			System.out.println(e);			System.exit(-1);		}	}}