Hi All -
Our java application (servlets) has the option of generating a CSV file. We are adding LineFeed "\n" after each record we read from the database.
But when we save the file we are seeing an "extra" Line Feed (0A) at the end of the file ? Is there anyway we can eliminate this extra Line Feed programatically ?
response.setHeader("Content-Disposition","attachment; filename=reportdata.csv");
:
StringBuffer sb = new StringBuffer();
String str = "";
:
:
while (rs.next()) {
sb.append(rs.getString(1));
sb.append("\n");
}
str = sb.toString();
outString = str;
webPage wp = new webPage();
wp.contents (outString);
wp.output(response.getOutputStream());
Right now I don't have code for WebPage.class with me but I think it is from WebLogic
Thanks much.
Our java application (servlets) has the option of generating a CSV file. We are adding LineFeed "\n" after each record we read from the database.
But when we save the file we are seeing an "extra" Line Feed (0A) at the end of the file ? Is there anyway we can eliminate this extra Line Feed programatically ?
response.setHeader("Content-Disposition","attachment; filename=reportdata.csv");
:
StringBuffer sb = new StringBuffer();
String str = "";
:
:
while (rs.next()) {
sb.append(rs.getString(1));
sb.append("\n");
}
str = sb.toString();
outString = str;
webPage wp = new webPage();
wp.contents (outString);
wp.output(response.getOutputStream());
Right now I don't have code for WebPage.class with me but I think it is from WebLogic
Thanks much.