public void loadDataFromTextFile(String fileName) throws Exception {
		this.numData = KmeansClustering.countTotalLines(fileName);
		if (this.numData == 0) {
			throw new Exception("Fail in counting total lines number");
		}
		this.vecLen = KmeansClustering.countDimensionality(fileName);
		if (this.vecLen == 0) {
			throw new Exception("Fail in getting dimensionality");
		}
		this.id = new long[numData][3];
		this.data = new byte[numData][vecLen];
		// read real data
		BufferedReader reader = null;
		int tmpVecLen = this.vecLen;
		boolean exception = false;
		try {
			reader = new BufferedReader(new FileReader(new File(fileName)));
			for (int i = 0; i < this.numData; i++) {
				String inputLine = reader.readLine();
				String[] vectorValues = inputLine.split(" ");
				this.id[i][0] = Long.parseLong(vectorValues[0]);
				this.id[i][1] = Long.parseLong(vectorValues[1]);
				this.id[i][2] = Long.parseLong(vectorValues[2].split("\t")[0]);
				if (vectorValues.length < this.vecLen
						+ KmeansClustering.lineOffset) {
					tmpVecLen = vectorValues.length
							- KmeansClustering.lineOffset;
					System.out.println("Potential incorrect line: "
							+ vectorValues.length);
				} else {
					tmpVecLen = this.vecLen;
				}
				for (int j = 0; j < tmpVecLen; j++) {
					data[i][j] = (byte) (Integer.parseInt(vectorValues[j
							+ KmeansClustering.lineOffset]) - KmeansClustering.valueOffset);
				}
			}
			reader.close();
		} catch (Exception e) {
			exception = true;
		}
		// handle exception
		if (exception) {
			if (reader != null) {
				try {
					reader.close();
				} catch (Exception e) {
				}
			}
			throw new Exception("Fail in getting data");
		}
	}