/**
 * Append the string to the file.
 * @param filename
 * @param text
 */
public static void fileFromString(String filename, String text) {
	java.io.File file = new java.io.File(filename);
	try {
		java.io.FileWriter fw = new java.io.FileWriter(file, true);
		fw.write(text);
		fw.close();
	} catch (java.io.IOException ex) {
		Ts.printErr(ex);
	}
}
 
public static void printErr(java.lang.Exception ex) {
	printErr(ex.getMessage());
}


Back to JavaHowTo

Alumni Liaison

Ph.D. on Applied Mathematics in Aug 2007. Involved on applications of image super-resolution to electron microscopy

Francisco Blanco-Silva