This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading data from files like txt file, doc,csv extensions

 
Ranganath .S.Junpal
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I just wanted to know how to get the data from the files such as
.txt file/excel file /.doc file /.csv file as an input and store it to store in the database in a JSP.
The scenario is as follows:-
a) The text file contains the questions and 4 Options
b) my web app should recognise the question and put it in the database and like wise the respective questions should be stored in the database..

So how to distinguish the question and options and the correct answers from the these files.. .txt file/excel file /.doc file /.csv file

Looking forward fo r your replies at the earliest.

Thank you
Ranganath.S
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That depends on the layout of the data in the file, doesn't it? Java can read any of these file types (for XLS and DOC, there's the Jakarta POI library), but that won't help you much if the file contents are not regular in some fashion.

Is your question about how to parse files that don't have a fixed layout, is it about reading different types of files, is it about storing data to a database, or is it actually about JSP (since this is the JSP forum) ?
 
Ranganath .S.Junpal
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Firstly i would like to thank you for your reply.
As far as my question is concerned.. its about parsing the file.. and extracting the data ie(questions and options, correct answer) from the file of different extensions using a JSP page and uploading the same to the Database.
hope my question is clear now!! expecting your reply at earliest.

As you had mentioned about the POI Library , do let know like how it can help me to solve this..

Thank you
Ranganath.S
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, your question is not clear. If it is about all of these points, you should outline what you have done so far, so that we can see where you are stuck, and try to help you get going again.

Jakarta POI is a library that can read and write Word and Excel files. Its web site goes into a lot of detail on that, and has a bunch of examples.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic