public synchronized static void transformToSVMFormat(final List<Measurement> data, String fileName, boolean isNew)
	{
		
		File testfile = new File(fileName); 
		try {
			BufferedWriter writertest = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(testfile)));
			Hashtable<Integer, Integer> rssis = new Hashtable<Integer, Integer>();
			Vector<Integer> sarray = new Vector<Integer>();
			for (Measurement m : data){
				Integer categoryID = -1;
				if (!isNew) {
					categoryID = getLocationCategory(m);
					if (categoryID == -1) continue;
				}
				StringBuffer line = new StringBuffer();
				line.append(categoryID);
				for (WiFiReading r : m.getWiFiReadings()) {
					if (r != null && r.getBssid() != null) {
						Integer id = CategorizerFactory.BSSIDCategorizer().GetCategoryID(r.getBssid());
						if (id != -1 && !rssis.contains(id)) {
							rssis.put(id, r.getRssi());
							sarray.add(id);
						}
					}
				}
				Collections.sort(sarray);
				for(int i = 0; i < sarray.size(); i++) {
					if (rssis.get(sarray.get(i)) != null) line.append(" " + sarray.get(i) + ":" + rssis.get(sarray.get(i)));
				}
				line.append("\n");
				writertest.write(line.toString());
				rssis.clear();
				sarray.clear();
			}
			writertest.close();
			
		} catch (FileNotFoundException e) {
			Log.getLogger().log(Level.SEVERE, "transformToSVMFormat failed due to FileNotFoundException: " + e.getMessage());
		} catch (IOException e) {
			Log.getLogger().log(Level.SEVERE, "transformToSVMFormat failed due to IOException: " + e.getMessage());
		}
	}