public void writeDataFile() throws IOException {

		String[] filename = this.dataFolder.list();
		BufferedWriter output = new BufferedWriter(
				new FileWriter(this.dataFile));
		for (String label : filename) {

			if (label.contains("Sample")) {

				String path = this.dataFolderName + File.separator + label;
				String realLabel = label.substring(7);
				if (realLabel.charAt(0) == '0') {
					realLabel = realLabel.substring(1);
				}
				String[] exampleName = (new File(path)).list();

				for (int i = 0; i < size; i++) {

					if (exampleName[i].contains("img")) {
						/* Here we deal with each example */
						String examplePath = path + File.separator
								+ exampleName[i];
						System.out.println("Reading File: " + examplePath);
						BufferedImage exampleImage = ImageIO.read(new File(
								examplePath));

						// For our data set the png image is 128 * 128;
						String featureString = this
								.featureStringConstruction(ExtractFeature
										.extractIntBinary(ImageReader
												.readGreyImage(exampleImage)));
						
						output.write( realLabel + " " + featureString );
					}

				}
			}
		}

		output.flush();
		output.close();
	}