public static int countLines(String file) {
		try {
			BufferedReader reader;
			reader = new BufferedReader(new FileReader(file));
			int lines = 0;
			while (reader.readLine() != null)
				lines++;
			reader.close();
			return lines;
		} catch (Exception e) {
			return -1;
		}
	}