Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Reading in a *.csv file and loading the data  RSS feed

 
sharon christa
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Posts: 66205
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Tim Moores
Saloon Keeper
Posts: 3888
91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't try to parse the CSV files in your code, use one of the libraries listed in the "Excel" section of http://www.coderanch.com/how-to/java/AccessingFileFormats
 
Vicky Vijay
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Please refer the below reference links,


Reference 1

Reference2

Reference3

Reference4
 
Rob Spoor
Sheriff
Posts: 21092
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!