private static void writeAllData(String filename) throws IOException
	{
		FileWriter fw = new FileWriter(filename, false);
		HashMap<String, Averaging> statistic = new HashMap<String, Averaging>();  
		
		//
		// Write header to file
		//
		Object[] headers = keys.keySet().toArray();
		java.util.Arrays.sort(headers);
		
		StringBuffer headersStr = new StringBuffer();
		headersStr.append("file name");
		headersStr.append(SEPARATOR_OUT);
		
		for(Object header : headers) {
			headersStr.append(header.toString());
			headersStr.append(SEPARATOR_OUT);
			
			statistic.put(header.toString(), new Averaging());
		}
		
		fw.write(headersStr.toString());
		fw.write(NEW_LINE);
		
		//
		// Write data to file
		//
		System.out.println("Write statistic to '" +filename +"' with " +headers.length +" column");
		
		Object[] filenames = allData.keySet().toArray();
		java.util.Arrays.sort(filenames);
		
		for(Object file : filenames) {
			HashMap<String, String> data = allData.get(file);
			
			// write filename to file
			StringBuffer dataStr = new StringBuffer();	
			dataStr.append(file);
			dataStr.append(SEPARATOR_OUT);
			
			// write all values to file
			for(Object header : headers) {
				String value = data.get(header);
				
				if(value != null) {
					dataStr.append(value);
				}
				statistic.get(header.toString()).add(value);
				dataStr.append(SEPARATOR_OUT);
			}
			
			fw.write(dataStr.toString());
			fw.write(NEW_LINE);
		}

		// write statistic
		// 1. average
		StringBuffer dataStr = new StringBuffer();	
		dataStr.append("Average");
		dataStr.append(SEPARATOR_OUT);

		for(Object header : headers) {
			String value = statistic.get(header).toString();
			
			dataStr.append(value);
			dataStr.append(SEPARATOR_OUT);
		}
		
		fw.write(dataStr.toString());
		fw.write(NEW_LINE);
		
		// 2. diff to min
		dataStr = new StringBuffer();	
		dataStr.append("Diff to min value");
		dataStr.append(SEPARATOR_OUT);

		for(Object header : headers) {
			String value = statistic.get(header).getDiffToMin();
			
			dataStr.append(value);
			dataStr.append(SEPARATOR_OUT);
		}
		
		fw.write(dataStr.toString());
		fw.write(NEW_LINE);
		
		// 3. diff to max
		dataStr = new StringBuffer();	
		dataStr.append("Diff to max value");
		dataStr.append(SEPARATOR_OUT);

		for(Object header : headers) {
			String value = statistic.get(header).getDiffToMax();
			
			dataStr.append(value);
			dataStr.append(SEPARATOR_OUT);
		}
		
		fw.write(dataStr.toString());
		fw.write(NEW_LINE);
		
		//
		// Close file
		//
		fw.close();
	}