aspose file tools
The moose likes JSP and the fly likes Reading in a *.csv file and loading the data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Reading in a *.csv file and loading the data " Watch "Reading in a *.csv file and loading the data " New topic

Reading in a *.csv file and loading the data

sharon christa

Joined: Mar 01, 2012
Posts: 8
I would like to know any advice for creating a jsp program that will read in a *.csv file and load the data for further processing. I want to identify each attribute in it and the total rows present in it also. Please advice
Thank you sooo much in advance
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 62113

That would be a horrible misuse of technology. JSP is intended to create HTML views, not to process data. Process the CSV in a servlet or other Java class, not a JSP.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Tim Moores

Joined: Sep 21, 2011
Posts: 2409
Don't try to parse the CSV files in your code, use one of the libraries listed in the "Excel" section of
Vicky Vijay
Ranch Hand

Joined: Apr 23, 2008
Posts: 125

Please refer the below reference links,

Reference 1



Rob Spoor

Joined: Oct 27, 2005
Posts: 19897

Please ignore those first two links. StringTokenizer and splitting Strings on commas is not a good approach to parsing CSV files. There is a lot more to them than just comma's; there's quoting of values which allows comma's inside values. The third link looks better, but I'd still go for an existing CSV parsing library.

How To Ask Questions How To Answer Questions
Don't get me started about those stupid light bulbs.
subject: Reading in a *.csv file and loading the data