String str = "";
try {
BufferedReader br = new BufferedReader(new FileReader(file.getAbsolutePath()));
while (br.readLine() != null) {
str += br.readLine();
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String replace = str.replace("HTTP Request: ", "")
.replace("Resource URL: ","")
.replace("Attribute\t\tDescription", "| Attribute | Type | Description |<P>|----|----|<P>")
.replace("Data Type | Max Length | Requirement |", "")
.replace("N/A", "Object")
.replace("String", "| String")
.replace("255 |", "")
.replace("Required", "**Required**")
.replace("Optional", "**Optional**")
.replace("Request Example <P>", "")
.replace("Response Example <P>", "Nothing");
PrintWriter pw = null;
The BufferedReader ignores the first 3 lines and reads/converts the rest. Not sure as to what the issue is. I have tried other StackOverflow solutions but none of them seem to work!