File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Problem in csv file upload Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problem in csv file upload" Watch "Problem in csv file upload" New topic
Author

Problem in csv file upload

parthi
Greenhorn

Joined: Dec 09, 2007
Posts: 5
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

Joined: Apr 14, 2004
Posts: 10336

"parthi"

Please check your private messages for a message from me.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
 
subject: Problem in csv file upload
 
Similar Threads
reading csv file
Reading csv file
reading a csv file in ant
StringTokenizer .csv file
Creating XML -- Need help