Hello Everybody i have a .txt file that is loaded by my program and the first line is read and printed to a new file. In the resource .txt file everything has "" around what should stay the same, and +example_var+ where a String var should be placed. The generated file does not replace +example_var+ with the correct var, it just puts in "STAY SAME TEXT"+example_var+"STAY SAME TEXT". My goal is to replace the +example_var+ with the actual value of the String var exmaple_var. Some of the code below.
File f = new File("weap_file.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(f), "US-ASCII"));
String line = br.readLine();
BufferedWriter Wwriter = null;
Wwriter = new BufferedWriter( new FileWriter( folder_path+global.Fname ));
Re: Read Line
The StringBuilder class could be what you need.
#StringBuilder (Java 2 Platform SE 5.0)
If you are feeling a litle bit more adventurous you could also look into using regex.
EDIT: Here is the documentation for Java 7.
StringBuilder (Java Platform SE 7)