Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in csv file upload

 
parthi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In our application we are uploading a .csv file value to database.I am reading the comma delimited (.csv) file line by line and validating the values.Using StringTokenizer i am making string arry and validating the values.

I am using following code to read comma delimited (.csv) file.


// Code

StringBuffer strTemp = new StringBuffer();
bufReader = new BufferedReader(new InputStreamReader(uploadForm
.getDocFile().getInputStream()));
while ((line = bufReader.readLine()) != null) {
......

}


Problem:

When the user uses Alt+enter within the cell value ,reader is not reading full line.Since the line separator is there, it is taking the value after the Alt+enter as second line value.

Can anyone help me to solve this issue? Please suggest me anyother way to do read the complete line
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"parthi"

Please check your private messages for a message from me.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic