public static void replaceAll(File textFile, String substr, String newstr) {
		if (!textFile.exists() || !textFile.isFile()) {
			return;
		}
		try {
			BufferedReader inp = new BufferedReader(new FileReader(textFile));
			StringBuffer buff = new StringBuffer();
			while (true) {
				String line = inp.readLine();
				if (line == null) {
					break;
				}
				buff.append(line);
				buff.append('\n');
			}
			inp.close();
			String s = buff.toString().replaceAll(escape(substr), escape(newstr));
			PrintWriter out = new PrintWriter(new FileWriter(textFile));
			out.print(s);
			out.close();
		} catch (IOException ex) {
			ex.printStackTrace();
		}
	}